hill-98/php-cs-fixer-config

Just a PHP CS Fixer rule set

1.1.0 2021-06-29 10:25 UTC

This package is auto-updated.

Last update: 2024-05-07 15:20:51 UTC


README

Packagist Version Packagist Downloads MIT PHPUnit Test

Based on the PSR12 rule set to expand

Install

composer require hill-98/php-cs-fixer-config --dev

You can also go to the releases of the latest version

Usage

.php-cs-fixer.php:

<?php

// Allow Risky rules
// const RISKY = true;

$finder = PhpCsFixer\Finder::create()
    ->exclude('somedir')
    ->notPath('src/Symfony/Component/Translation/Tests/fixtures/resources.php')
    ->in(__DIR__);

// These rules will be merged and set ($rules must be array)
$rules = [];

// Extended $config ($config must be \PhpCsFixer\ConfigInterface)
// $config = new PhpCsFixer\Config();

/** @var \PhpCsFixer\Config $config */
$config = require __DIR__.'/vendor/hill-98/php-cs-fixer-config/main.php';

// Auto set $finder ($finder must be iterable)
// $config->setFinder($finder); // Don't repeat SET

return $config;