Updated phpstan/phpstan to version 2.x#21
Conversation
Bumped the phpstan/phpstan dependency from ^1.0 to ^2.0 in composer.json to use the latest major version for improved static analysis.
There was a problem hiding this comment.
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/phpstanto^2.0and addphpstan/phpstan-strict-rulestorequire-dev. - Enable strict rules via
phpstan.neon.distinclude and remove the prior customMatchExpressionRuleservice override. - Adjust
composer analysememory limit and normalizeextrato 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.
| "phpstan/phpstan": "^2.0", | ||
| "phpstan/phpstan-strict-rules": "^2.0", | ||
| "swoole/ide-helper": "dev-master" |
There was a problem hiding this comment.
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.
| includes: | ||
| - vendor/phpstan/phpstan-strict-rules/rules.neon | ||
| # 需要执行 composer require phpstan/phpstan-deprecation-rules --dev | ||
| # - vendor/phpstan/phpstan-deprecation-rules/rules.neon |
There was a problem hiding this comment.
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).
Bumped the phpstan/phpstan dependency from ^1.0 to ^2.0 in composer.json to use the latest major version for improved static analysis.