programic / pro-code-quality
Programic Quality Control package
dev-main
2022-02-15 18:32 UTC
Requires
- php: ^7.4|^8.0
- ext-json: *
- nunomaduro/larastan: ^0.7.15
- phpmd/phpmd: ^2.10
- povils/phpmnd: ^2.4
- sebastian/phpcpd: ^6.0
- slevomat/coding-standard: ^7.0
- symplify/coding-standard: ^9.3
- symplify/easy-coding-standard: ^9.4
This package is auto-updated.
Last update: 2024-11-16 00:12:45 UTC
README
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
How to add to your project
-
Add remote repository:
$ composer config --append repositories.pro-qa vcs git@bitbucket.org: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).
How to run the code quality checks
Run all the checks
$ composer check
Run a specific check:
$ composer check:ecs $ composer check:phpmd $ composer check:phpmnd $ composer check:phpcpd $ composer check:phpstan