Skip to content

Updated phpstan/phpstan to version 2.x#21

Merged
limingxinleo merged 4 commits intohyperf:masterfrom
huangdijia:phpstan-2.0
Mar 7, 2026
Merged

Updated phpstan/phpstan to version 2.x#21
limingxinleo merged 4 commits intohyperf:masterfrom
huangdijia:phpstan-2.0

Conversation

@huangdijia
Copy link
Copy Markdown
Member

Bumped the phpstan/phpstan dependency from ^1.0 to ^2.0 in composer.json to use the latest major version for improved static analysis.

Bumped the phpstan/phpstan dependency from ^1.0 to ^2.0 in composer.json to use the latest major version for improved static analysis.
@huangdijia huangdijia changed the title Update phpstan/phpstan to version 2.x Updated phpstan/phpstan to version 2.x Jul 20, 2025
Copilot AI review requested due to automatic review settings March 7, 2026 02:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades the project’s PHPStan setup to the 2.x major line and updates related configuration so static analysis continues to run in CI.

Changes:

  • Bump phpstan/phpstan to ^2.0 and add phpstan/phpstan-strict-rules to require-dev.
  • Enable strict rules via phpstan.neon.dist include and remove the prior custom MatchExpressionRule service override.
  • Adjust composer analyse memory limit and normalize extra to an object.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
phpstan.neon.dist Enables phpstan-strict-rules and simplifies PHPStan rule configuration.
composer.json Updates PHPStan dependencies and tweaks the analysis script configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread composer.json
Comment on lines +54 to 56
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"swoole/ide-helper": "dev-master"
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR metadata/description says this change only bumps phpstan/phpstan to ^2.0, but this hunk also introduces a new dev dependency (phpstan/phpstan-strict-rules) and changes the phpstan script memory limit. Please update the PR title/description to reflect the additional scope (or split these changes into a separate PR) so reviewers/CI expectations match the actual diff.

Copilot uses AI. Check for mistakes.
Comment thread phpstan.neon.dist
Comment on lines 6 to 9
includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
# 需要执行 composer require phpstan/phpstan-deprecation-rules --dev
# - vendor/phpstan/phpstan-deprecation-rules/rules.neon
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change adds phpstan-strict-rules via an include, which is additional scope beyond the PR description (“Updated phpstan/phpstan to version 2.x”). Please ensure the PR metadata is updated to mention strict rules being enabled (since it can materially change the analysis baseline).

Copilot uses AI. Check for mistakes.
@limingxinleo limingxinleo merged commit 245a7f1 into hyperf:master Mar 7, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants