Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"hyperf/devtool": "3.2.*",
"hyperf/testing": "3.2.*",
"mockery/mockery": "^1.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"swoole/ide-helper": "dev-master"
Comment on lines +54 to 56
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.
},
"autoload": {
Expand All @@ -73,15 +74,15 @@
"optimize-autoloader": true,
"sort-packages": true
},
"extra": [],
"extra": {},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-autoload-dump": [
"rm -rf runtime/container"
],
"analyse": "phpstan analyse --memory-limit 512M",
"analyse": "phpstan analyse --memory-limit 1G",
"cs-fix": "php-cs-fixer fix $1",
"start": "php ./bin/hyperf.php start",
"test": "co-phpunit --prepend test/bootstrap.php --colors=always",
Expand Down
7 changes: 3 additions & 4 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
# vendor/bin/phpstan analyse app --memory-limit 200M -l 0
#
includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
# 需要执行 composer require phpstan/phpstan-deprecation-rules --dev
# - vendor/phpstan/phpstan-deprecation-rules/rules.neon
Comment on lines 6 to 9
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.

parameters:
level: 0
paths:
Expand All @@ -24,9 +26,6 @@ services:
# When using `match` to match enum, the enumeration must be completely overwritten
- class: PHPStan\Rules\Comparison\MatchExpressionRule
arguments:
checkAlwaysTrueStrictComparison: %checkAlwaysTrueStrictComparison%
disableUnreachable: %featureToggles.disableUnreachableBranchesRules%
reportAlwaysTrueInLastCondition: %reportAlwaysTrueInLastCondition%
treatPhpDocTypesAsCertain: %treatPhpDocTypesAsCertain%
tags:
- phpstan.rules.rule
- phpstan.rules.rule