baijunyao/php-cs-fixer-config

Custom PHP CS Fixer

v0.3.1 2024-06-18 00:37 UTC

This package is auto-updated.

Last update: 2024-11-18 01:33:31 UTC


README

Uniformly manage the code style of all projects.

Installation

Require this package with composer using the following command:

composer require baijunyao/php-cs-fixer-config --dev

Usage

Create .php-cs-fixer.php in your project root directory.

<?php

declare(strict_types=1);

use Baijunyao\PhpCsFixer\Config;
use PhpCsFixer\Finder;

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

return (new Config())->setFinder($finder);

Add .php-cs-fixer.cache to .gitignore

Execute the following command.

vendor/bin/php-cs-fixer fix

Example