baijunyao/php-cs-fixer-config

Custom PHP CS Fixer

v0.3.0 2023-09-19 15:00 UTC

This package is auto-updated.

Last update: 2024-04-19 16:25:17 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