nberces/php-cs-fixer-config

An opinionated configuration for friendsofphp/php-cs-fixer.

v2.01 2020-09-02 03:37 UTC

This package is auto-updated.

Last update: 2024-04-29 04:28:06 UTC


README

This package provides an opinionated configuration for PHP CS Fixer.

These instructions assume you have PHP CS Fixer already installed.

Usage

Create a local PHP CS Fixer configuration file (i.e. .php_cs) at the root-level of your project with the following contents:

<?php

use NBerces\PHPCSFixerConfig\Config;
use PhpCsFixer\Finder;

$finder = Finder::create()
    ->exclude('vendor')
    ->in(__DIR__);

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

return $config;

Then run:

$ php-cs-fixer fix

Alternatively, name your configuration file something other than .php_cs (e.g. .php_cs_myconfig) and run:

$ php-cs-fixer fix --config=.php_cs_myconfig