apeschar/php-cs-fixer

3.0 2021-12-08 09:20 UTC

This package is auto-updated.

Last update: 2024-09-16 15:33:28 UTC


README

这是为了将我的PHP-CS-Fixer规则集中在一个地方,以便更改它们会影响所有项目。

它还使用git ls-files '*.php'列出目标文件,而不是使用Symfony的finder。这要快得多,并且自动避免未版本化的文件。

安装

在项目的子目录中安装PHP-CS-Fixer和此包

mkdir -p tools/php-cs-fixer
composer --working-dir=tools/php-cs-fixer \
    require friendsofphp/php-cs-fixer apeschar/php-cs-fixer

初始化.php-cs-fixer.dist.php

cat > .php-cs-fixer.dist.php <<EOF
<?php
use Kibo\PhpCsFixer\Factory;
return (new Factory(__DIR__))->config();
EOF

运行php-cs-fixer

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