daniel-de-wit/php-cs-fixer-rules

PHP-CS-Fixer Ruleset

v1.0.1 2021-12-23 14:45 UTC

This package is auto-updated.

Last update: 2024-10-23 21:34:08 UTC


README

Software License Latest Version on Packagist Total Downloads

A custom ruleset for PHP-CS-Fixer.

Rules

See rules.

Installation

You can install the package via composer:

composer require --dev daniel-de-wit/php-cs-fixer-rules

Configuration

Add .php-cs-fixer.dist.php with directories and optional custom rules.

<?php

$finder = PhpCsFixer\Finder::create()
  ->in([
    __DIR__.'/app',
    __DIR__.'/config',
    __DIR__.'/database',
    __DIR__.'/routes',
    __DIR__.'/tests',
  ]);
  
$customRules = [];
 
return DanielDeWit\phpcsfixer($finder, $customRules);

Usage

Automatically fix all files.

vendor/bin/php-cs-fixer fix

Composer Script

Update composer.json with script.

{
    "scripts": {
        "php-cs-fixer": [
            "vendor/bin/php-cs-fixer fix"
        ]
    }
}

Credits

License

The MIT License (MIT). Please see License File for more information.