PHPQA Analyzer CLI tool

By Jesus Manuel Olivas ● Head of Products | July 20th, 2015

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.

PHPQA a new project was born

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.

Project Overview

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.

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.

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.