insiders/php-coding-standards

Contains a set of rules for PHP-CS-Fixer

v2.0.4 2024-04-11 10:23 UTC

This package is auto-updated.

Last update: 2024-05-11 10:36:27 UTC


README

Installation

composer require --dev insiders/php-coding-standards

Usage

Place a file named .php-cs-fixer.dist.php that has the following content in your project root directory.

<?php

declare(strict_types=1);

use Insiders\PhpCodingStandards\PhpCsFixer\Rules;
use PhpCsFixer\Config;
use PhpCsFixer\Finder;

return (new Config())
    ->setRules(Rules::getRulesForPHP72())
    ->setRiskyAllowed(true)
    ->setFinder(Finder::create()->in(__DIR__))
    ->setCacheFile('.php-cs-fixer.cache');

Manual execute

Run following command in your project to fix every .php file.

./vendor/bin/php-cs-fixer fix