Additional rules for PHPStan, mostly focused on Clean Code and architecture conventions.
composer require phauthentic/phpstan-rules --devSee Rules documentation for a list of available rules and configuration examples.
Available Rules:
- Control Structure Nesting Rule
- Too Many Arguments Rule
- Readonly Class Rule
- Dependency Constraints Rule
- Final Class Rule
- Namespace Class Pattern Rule
A lot of the rules use regex patterns to match things. Many people are not good in writing them but thankfully there is AI today.
If you struggle to write the regex patterns you need, you can use AI tools like ChatGPT to help you generate them. Just describe what you want to match, and it can provide you with a regex pattern that fits your needs. The regex can be tested using online tools like regex101.
This library is under the MIT license.
Copyright Florian Krämer