odan/phpstan-rules
最新稳定版本:0.2.0
Composer 安装命令:
composer require odan/phpstan-rules
包简介
PHPStan rules
README 文档
README
A collection of PHPStan rules.
Requirements
- PHP 8.2+
Installation
composer require odan/phpstan-rules --dev
To use the PHPStan rules, you need to include the classes
in your PHPStan configuration file phpstan.neon.
Just pick the rule(s) you want:
rules: - Odan\PHPStan\Rules\AssignmentInConditionRule - Odan\PHPStan\Rules\YodaConditionRule
If you want to include all rules, you have to include rules.neon in your project's PHPStan config:
includes: - vendor/odan/phpstan-rules/rules.neon
Register CyclomaticComplexityRule in phpstan.neon
Add a new service configuration and change the maxComplexity as needed.
services: - class: Odan\PHPStan\Rules\CyclomaticComplexityRule arguments: maxComplexity: 3 tags: - phpstan.rules.rule
Note: If exists, remove the rule Odan\PHPStan\Rules\CyclomaticComplexityRule from the rules: section in phpstan.neon
Rules
- AssignmentInConditionRule
- YodaConditionRule
- CyclomaticComplexityRule
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 5.62k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-31