Composer package that includes all the packages required by the Definition of Done for Code Quality.
- PHPMD: PHP Mess Detector
- PHPStan: PHP Static Analysis
- PHPMND: PHP Magic Number Detection
- PHPCPD: PHP Copy & Paste Detection
- ECS: Easy Coding Standards
- includes
PHP_CodeSniffer
andPHP-CS-Fixer
- Additional rules:
- symplify/coding-standard
- slevomat/coding-standard
- includes
-
Add remote repository:
$ composer config --append repositories.pro-qa vcs [email protected]:programic/pro-quality-control.git
-
Make sure the
minimum-stability
is set todev
:$ composer config minimum-stability dev
-
Require the package:
$ composer require --dev programic/quality-control
-
Copy the example config files for each tool to your project:
- ecs.example.php ->
/ecs.php
- phpmd.example.xml ->
/phpmd.xml
- phpstan.example.neon ->
/phpstan.neon
Adjust the rules as needed.
- ecs.example.php ->
-
Add the scripts to your
composer.json
(see example in composer.example.json).
$ composer check
$ composer check:ecs
$ composer check:phpmd
$ composer check:phpmnd
$ composer check:phpcpd
$ composer check:phpstan