jadu/php-style

Jadu PHP coding style configuration for PHP-CS-Fixer

2.0.1 2023-08-18 14:14 UTC

README

Require the php-style dev dependency:

composer require --dev jadu/php-style

In your project's .php-cs-fixer.dist.php config file use the Config class as follows:

<?php

require_once __DIR__ . '/vendor/jadu/php-style/src/Config.php';

use Jadu\Style\Config;
use PhpCsFixer\Finder;

$finder = Finder::create();
$finder->in(__DIR__ . '/src');
$finder->in(__DIR__ . '/tests/unit');

$config = new Config();
$config->setFinder($finder);

return $config;

Now add phpcs to your project's build tasks.

Example CI command:

vendor/bin/php-cs-fixer --dry-run -v fix