##Description
gizra/robo-phpcs
is a PHP trait that provides a Robo command to check the coding standard of Drupal projects. This library makes it easy to adhere to Drupal and DrupalPractice coding standards. It's implemented as a PHP trait which you can include in your Robo tasks.
- PHP 8.1 or higher
- Robo 4.0 or higher
Install this package as a development dependency via composer:
composer require --dev gizra/robo-phpcs
Include the PhpcsTasks
trait in your RoboFile.php
to use the phpcs
command in your tasks.
<?php
namespace YourNamespace;
use Robo\Tasks;
use GizraRobo\PhpcsTasks;
class RoboFile extends Tasks {
use PhpcsTasks;
// Your other tasks
}
Once the trait is included, you can use the phpcs
task in your Robo commands:
robo phpcs
This will run the PHP Code Sniffer and the PHP Code Beautifier and Fixer for the directories specified, adhering to Drupal and DrupalPractice coding standards.
The trait includes a set list of directories and file types to scan. If you want to customize this, you can override the respective variables in your RoboFile.php
.