gizra/robo-phpcs

There is no license information available for the latest version (0.1.1) of this package.

Coding standard check Robo command as PHP trait

0.1.1 2023-09-22 04:09 UTC

This package is not auto-updated.

Last update: 2024-04-20 05:23:50 UTC


README

##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.

Requirements

  • PHP 8.1 or higher
  • Robo 4.0 or higher

Installation

Install this package as a development dependency via composer:

composer require --dev gizra/robo-phpcs

Usage

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
}

Running the phpcs task

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.

Options and Configuration

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.