What problem does it solve?
This skill eliminates the tedious manual effort of enforcing consistent Magento 2 code quality by running a comprehensive suite of automated checks (PSR-12, PHPStan, PHP_CodeSniffer, and PHP Mess Detector) across the codebase.
Core Features & Use Cases
- PSR-12 Compliance Check: Validates strict PSR-12 adherence, including braces, spacing, and use statement order.
- Static Analysis & Style Enforcement: Performs PHPStan analysis, Magento2-specific PHP_CodeSniffer checks, and code complexity auditing with PHP Mess Detector.
- Use Case: Integrate into CI to catch style and quality regressions before merging, or run locally during feature development to maintain high-quality Magento 2 modules.
Quick Start
Run the following commands to perform the standard quality checks on your project:
vendor/bin/php-cs-fixer fix --dry-run --diff
vendor/bin/phpstan analyse -c phpstan.neon
vendor/bin/phpcs --standard=Magento2 app/code/
vendor/bin/phpmd app/code/ text cleancode,codesize,design,naming,unusedcode