guanguans / phpstan-rules
A set of additional rules for phpstan/phpstan. - 一套针对 `phpstan/phpstan` 的附加规则。
Fund package maintenance!
Sponsors
Installs: 479
Dependents: 5
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/guanguans/phpstan-rules
Requires
- php: >=7.4
- illuminate/support: ^8.83 || ^9.0 || ^10.0 || ^11.0 || ^12.0
- phpstan/phpstan: ^2.1
Requires (Dev)
- adamwojs/php-cs-fixer-phpdoc-force-fqcn: ^2.0
- bamarni/composer-bin-plugin: ^1.8
- brainmaestro/composer-git-hooks: ^2.8 || ^3.0
- composer/composer: ^2.9
- ergebnis/composer-normalize: ^2.48
- ergebnis/license: ^2.7
- ergebnis/php-cs-fixer-config: ^6.58
- ergebnis/phpstan-rules: ^2.12
- ergebnis/rector-rules: ^1.9
- fakerphp/faker: ^1.24
- guanguans/php-cs-fixer-custom-fixers: ^1.1
- guanguans/rector-rules: ^1.3
- mockery/mockery: ^1.6
- nette/utils: ^3.2 || ^4.0
- pestphp/pest: ^1.23 || ^2.0 || ^3.0 || ^4.0
- php-mock/php-mock-phpunit: ^2.14
- phpbench/phpbench: ^1.2
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-mockery: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpstan/phpstan-webmozart-assert: ^2.0
- phpunit/phpunit: ^9.6 || ^10.0 || ^11.0 || ^12.0
- povils/phpmnd: ^3.6
- rector/argtyper: ^0.6
- rector/jack: ^0.5
- rector/swiss-knife: ^2.3
- rector/type-perfect: ^2.1
- shipmonk/composer-dependency-analyser: ^1.8
- shipmonk/dead-code-detector: ^0.14
- shipmonk/name-collision-detector: ^2.1
- shipmonk/phpstan-baseline-per-identifier: ^2.3
- shipmonk/phpstan-rules: ^4.3
- spatie/pest-plugin-snapshots: ^1.1 || ^2.0
- spaze/phpstan-disallowed-calls: ^4.7
- staabm/annotate-pull-request-from-checkstyle: ^1.8
- staabm/phpstan-todo-by: ^0.3
- staabm/side-effects-detector: ^1.0
- symfony/thanks: ^1.3
- symfony/var-dumper: ^5.4 || ^6.0 || ^7.0 || ^8.0
- symplify/phpstan-rules: ^14.9
- tomasvotruba/class-leak: ^2.1
- tomasvotruba/cognitive-complexity: ^1.0
- tomasvotruba/ctor: ^2.2
- tomasvotruba/type-coverage: ^2.1
- tomasvotruba/unused-public: ^2.2
- yamadashy/phpstan-friendly-formatter: ^1.2
Suggests
- staabm/side-effects-detector: Required to use the rule [ForbiddenSideEffectsRule].
This package is auto-updated.
Last update: 2026-01-19 07:08:56 UTC
README
Note
A set of additional rules for phpstan/phpstan. - 一套针对 phpstan/phpstan 的附加规则。
Requirement
- PHP >= 7.4
Installation
composer require guanguans/phpstan-rules --dev --ansi -v
If you also install phpstan/extension-installer then you're all set!
Manual installation
If you don't want to use phpstan/extension-installer, include rules.neon in your project's PHPStan config:
includes: - vendor/guanguans/phpstan-rules/config/rules.neon
Usage
Parameter configuration refer to the parameter section the configuration file [config/rules.neon].
You can also refer to the configuration file [tests/Rule/.../.../config/configured_rule.neon] in the tests directory.
Composer scripts
composer checks:required
composer php-cs-fixer:fix
composer phpstan-rules:fix-neon-files
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.