One point we know need more love and atenttion at DrupalConsole project is to increase the test coverage. Even when I had some previous experience using tools like PHPUnit and Behat. I decided to start researching for material related to this topic and how to automate test execution.
After trying to include a variation of the code I found on the blog post mentioned above, you can see code at CodeQualityTool.php. I decided to decouple this feature and publish an advanced version of this on a separated project.
This project aims to serve as a CLI tool to make easy the use of different PHP tools related to Quality Assurance and code analysis in PHP.
Every analyzer tool handles arguments and options using different formats, the goal of this project is to provide a single way to interact with those projects, you can also set options and arguments using a default configuration file when the project supports it.
The PHP Coding Standards Fixer tool fixes most issues in your code when you want to follow the PHP coding standards as defined in the PSR-1 and PSR-2 documents.
PHP_CodeSniffer is a set of two PHP scripts; the main phpcs script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second phpcbf script to automatically correct coding standard violations.
It is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly and easy to configure frontend for the raw metrics measured by PHP Depend.
phpdcd is a Dead Code Detector (DCD) for PHP code. It scans a PHP project for all declared functions and methods and reports those as being "dead code" that are not called at least once.
This is just the beginning of the project the real goal is to provide a tool to take advantage of all those great projects and make easy to customize and execute.
This project was built to be fully customizable. I will be working on the documentation related to override default configurations, but in the meantime please please visit https://github.com/jmolivas/phpqa#override-configuration and give a try and as usual, comments and suggestions are more than welcome.
NOTE: Image used on this bog post, originally from xkcd comic Quality Code at https://xkcd.com/1513/
Ready to embrace the JAMstack revolution?
Build fast and secure sites and apps delivered by pre-rendering files and serving them directly from a CDN, removing the requirement to manage or run web servers, databases and worry about traffic spikes.