To contactinue in English go to readme.en
A tool for automating control over the quality of the application of applications written on PHP, as well as simplifying the analysis and visualization of some metrics.
The idea of its creation was inspired by the book Pure Architecture (Robert Martin). If you have not read it yet, you can familiarize yourself with its key ideas on which the tool is based https://habr.com/en/post/504590/
composer require v.chetkov/php-clean-architecture --devNext, we copy a sample config to the root of the project
cp vendor/v.chetkov/php-clean-architecture/example.phpca-config.php phpca-config.phpAll the details of the configuration are described in detail in the sample of the config https://github.com/chetkov/php-clean- Architecture/blob/master/example.phpca-config.php, as well as in articles https://habr.com/en/post/504590/ and https://habr.com/en/post/686236/
vendor/bin/phpca-build-reports { ? path/to/phpca-config.php} The report visualizes the current state of the project, clearly displays the relationship between the components, their strength, the removal of the components from the main sequence, and also highlights the unwanted dependencies and other architectural problems detected on the basis of the config. 

vendor/bin/phpca-check { ? path/to/phpca-config.php}In case of violation by the code of restrictions specified by the config, informs of the discovered problems and completes the execution with the error. It is recommended to add the launch of this command in CI (this guarantees the compliance of the code that gets into the assembly, configured restrictions)
vendor/bin/phpca-allow-current-state { ? path/to/phpca-config.php}The team will maintain the current state of the project, the relationship between existing classes, into a separate file. With subsequent PHPCA-Check launches, problems related to the preserved state will be ignored.
This makes it possible to easily connect Php-Xlean-Architecture not only to new projects, but also to existing and already having problems, the elimination of which takes time.
If you want to verify the presence of problems or build a dependence graph and conduct an analysis not on the entire project, but by some part of it (for example, according to the list of changed files), you can set the value of the environment variable phpca_allowed_paths :
export PHPCA_ALLOWED_PATHS= ` git diff master --name-only ` PHPCA_REPORTS_DIR= ' phpca-report ' ; vendor/bin/phpca-build-reports { ? path/to/phpca-config.php}