bombenprodukt/php-cs-fixer-config

Provides a configuration factory and multiple rule sets for friendsofphp/php-cs-fixer.

2.0.0 2024-04-20 06:54 UTC

README

This project was created by, and is maintained by Brian Faust, and is a package that provides a configuration factory and multiple presets for friendsofphp/php-cs-fixer. Be sure to browse through the changelog, code of conduct, contribution guidelines, license, and security policy.

Installation

Note This package requires PHP 8.2 or later, and it supports Laravel 10 or later.

To get the latest version, simply require the project using Composer:

$ composer require faustbrian/php-cs-fixer-config

Usage

// .php-cs-fixer.php
<?php

use BaseCodeOy\PhpCsFixer\ConfigurationFactory;
use BaseCodeOy\PhpCsFixer\Preset\Standard;

$header = <<<EOF
Copyright (c) 2023 BaseCode Oy

For the full copyright and license information, please view
the LICENSE file that was distributed with this source code.
EOF;

$config = ConfigurationFactory::fromPreset(new Standard($header));
$config->getFinder()->in(__DIR__);

return $config;