Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hill-98/php-cs-fixer-config

Just a PHP CS Fixer rule set
https://github.com/hill-98/php-cs-fixer-config

Last synced: 10 days ago
JSON representation

Just a PHP CS Fixer rule set

Awesome Lists containing this project

README

        

# Just a PHP CS Fixer rule set

Packagist Version
Packagist Downloads
MIT
PHPUnit Test

Based on the [PSR12](https://cs.symfony.com/doc/ruleSets/PSR12.html) rule set to expand

## Install

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

You can also go to the [releases](https://github.com/Hill-98/php-cs-fixer-config/releases) of the latest version

## Usage

**`.php-cs-fixer.php`**:
```php
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;
```