我的 PHP-CS-Fixer 配置

v0.6.0 2024-06-02 11:36 UTC

README

我的个人 PHP-CS-Fixer 配置,用于所有我的 PHP 项目中。

通过 Composer 安装它: composer require jrmajor/cs 并在 .php-cs-fixer.php 中使用 Major\CS\config() 函数

<?php

$finder = PhpCsFixer\Finder::create()
    ->in(__DIR__)
    ->notPath('bootstrap/cache')
    ->notPath('node_modules')
    ->notPath('storage')
    ->notName('*.blade.php')
    ->notName('_ide_helper*.php')
    ->ignoreVCSIgnored(true);

return Major\CS\config($finder, ['overwritten_rule' => false]);

别忘了将 .php-cs-fixer.cache 添加到 .gitignore 文件中!