Download the PHP package eonx-com/easy-quality without Composer
On this page you can find all versions of the php package eonx-com/easy-quality. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eonx-com/easy-quality
More information about eonx-com/easy-quality
Files in eonx-com/easy-quality
Package easy-quality
Short Description Makes using of code quality tools for PHP projects of EonX easier
License MIT
Informations about the package easy-quality
---eonx_docs--- title: Introduction weight: 0 ---eonx_docs---
This package is a way to centralise reusable classes used for coding standards and quality tools. It contains:
Install (separately from the project's composer.json file)
- Create a
qualitydirectory in your project root. - Go to the
qualitydirectory and runcomposer require eonx-com/easy-quality. - Set env variables to speed up local execution:
EONX_EASY_QUALITY_JOB_SIZE- number of files to process in parallel (default: 2)EONX_EASY_QUALITY_MAX_NUMBER_OF_PROCESS- maximum number of parallel processes (default: 4)EONX_EASY_QUALITY_TIMEOUT_SECONDS- timeout in seconds for each process (default: 120)
- Add
quality/vendorto Git ignore (either in a.gitignorefile inside thequalitydirectory or in you project's root.gitignorefile). -
Update your project's
composer.jsonfile by adding a post-install script (this will automate an installation ofeonx-com/easy-qualityon all the local machines): -
Update your project's
composer.jsonfile by adding the following scripts. Here we useveewee/composer-run-parallel(install it as a dev dependency) for thecheck-allscript to run multiple commands in parallel. Feel free to modiy these commands as you wish. - Make sure you have config files for ECS, Rector, PHPStan, and Qualimetrix.
- Run
composer check-allfrom the project source code root to make sure everything is working and fix the found issues. - If you want to use the quality tools in CI, here is an example of a GitHub action configuration:
Prepare configuration file for ECS (Easy Coding Standard) Sniffs
Create a configuration file for ECS in the quality folder of the project.
For example see quality/ecs.php.
Run ECS check
Go to the root folder of the project and run
or
Expected output:
Configure PhpStorm to match ECS sorting
The ECS set sorts class members via OrderedClassElementsFixer. To make PhpStorm's Code | Reformat Code
(with Rearrange entries) produce exactly the same order, copy the code style scheme shipped with this package into
your project:
See docs/phpstorm/settings.md for details (including why this cannot be done via
.editorconfig).
Prepare configuration file for Rector
Create a configuration file for Rector in the quality folder of the project.
For example see quality/rector.php.
Run Rector check
Go to the root folder of the project and run
or
Expected output:
Using phpmetrics checker
Run
An example of pmc.json config file:
Using Qualimetrix checker
Create a configuration file for Qualimetrix in the quality folder of the project, e.g. quality/qmx.yaml.
Run
Expected output:
A short example of qmx.yaml config file, checking only coupling and complexity:
See the Qualimetrix documentation for the full list of rules and configuration options.
All versions of easy-quality with dependencies
jangregor/phpstan-prophecy Version 2.3.0
phpmd/phpmd Version 2.15.0
phpstan/phpdoc-parser Version 2.3.3
phpstan/phpstan Version ^2.1
phpstan/phpstan-strict-rules Version ^2.0
qualimetrix/qualimetrix Version 0.27.0
rector/rector Version 2.6.1
savinmikhail/add_named_arguments_rector Version ^0.1.25
slevomat/coding-standard Version 8.31.1
symplify/easy-coding-standard Version 13.2.17
symplify/phpstan-rules Version 14.10.0