https://github.com/guanguans/phpstan-rules
A set of additional rules for phpstan/phpstan.
https://github.com/guanguans/phpstan-rules
lint linter phpstan rule standard static-analysis
Last synced: 3 months ago
JSON representation
A set of additional rules for phpstan/phpstan.
- Host: GitHub
- URL: https://github.com/guanguans/phpstan-rules
- Owner: guanguans
- License: mit
- Created: 2026-01-14T08:12:01.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-03-28T14:00:18.000Z (3 months ago)
- Last Synced: 2026-03-28T16:49:42.180Z (3 months ago)
- Topics: lint, linter, phpstan, rule, standard, static-analysis
- Language: PHP
- Homepage:
- Size: 97.7 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# phpstan-rules
> [!NOTE]
> A set of additional rules for phpstan/phpstan. - 一套针对 `phpstan/phpstan` 的附加规则。
[](https://github.com/guanguans/phpstan-rules/actions/workflows/tests.yml)
[](https://github.com/guanguans/phpstan-rules/actions/workflows/php-cs-fixer.yml)
[](https://codecov.io/gh/guanguans/phpstan-rules)
[](https://packagist.org/packages/guanguans/phpstan-rules)
[](https://github.com/guanguans/phpstan-rules/releases)
[](https://packagist.org/packages/guanguans/phpstan-rules)
[](https://packagist.org/packages/guanguans/phpstan-rules)
## Requirement
* PHP >= 7.4
## Installation
```shell
composer require guanguans/phpstan-rules --dev --ansi -v
```
If you also install [phpstan/extension-installer](https://github.com/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:
```neon
includes:
- vendor/guanguans/phpstan-rules/config/rules.neon
```
## Usage
Parameter configuration refer to the parameter section the configuration file [[`config/rules.neon`](config/rules.neon)].
You can also refer to the configuration file [`tests/Rule/.../.../config/configured_rule.neon`] in the tests directory.
## Composer scripts
```shell
composer checks:required
composer php-cs-fixer:fix
composer phpstan-rules:fix-neon-files
composer test
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
* [guanguans](https://github.com/guanguans)
* [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.