Centralized static analysis configuration for PHP projects. Provides pre-configured rules for:
- PHPStan - Static analysis at max level
- PHPMD - Mess detector for code quality
- PHPCS - Code sniffer with PSR-12 and Doctrine standards
- PHP Insights - Code quality and architecture insights
composer require --dev mechemsi/static-rulesvendor/bin/phpstan analyse src testsConfiguration: phpstan.neon
vendor/bin/phpmd src,tests text phpmd.xmlConfiguration: phpmd.xml
vendor/bin/phpcs src tests
vendor/bin/phpcbf src tests # Auto-fixConfiguration: phpcs.xml
vendor/bin/phpinsightsConfiguration: phpinsights.php
composer phpstan # Run PHPStan
composer phpmd # Run PHPMD
composer phpcs # Run PHPCS
composer insights # Run PHP Insights
composer analyse # Run all (phpstan, phpmd, phpcs)- PHPStan: Level max with Symfony, Doctrine, PHPUnit, and strict rules extensions
- PHPCS: PSR-12 + Doctrine Coding Standard + Slevomat Coding Standard
- PHPMD: Clean code, code size, controversial, design, naming, unused code rules
- PHP Insights: Laravel/Symfony preset with architecture and complexity checks
- PHP >= 8.2