nberces / php-cs-fixer-config
为 friendsofphp/php-cs-fixer 提供一个具有偏见的配置。
v2.01
2020-09-02 03:37 UTC
Requires
- php: ^7.2
- friendsofphp/php-cs-fixer: 3.0.x-dev
Requires (Dev)
- phpunit/phpunit: ^8.0
- squizlabs/php_codesniffer: dev-master
- symfony/options-resolver: ^5.0
This package is auto-updated.
Last update: 2024-09-29 05:42:36 UTC
README
此包为 PHP CS Fixer 提供一个具有偏见的配置。
以下说明假设您已经安装了 PHP CS Fixer。
用法
在您的项目根目录创建一个本地的 PHP CS Fixer 配置文件(例如 .php_cs
),文件内容如下
<?php use NBerces\PHPCSFixerConfig\Config; use PhpCsFixer\Finder; $finder = Finder::create() ->exclude('vendor') ->in(__DIR__); $config = new Config(); $config->setFinder($finder); return $config;
然后运行
$ php-cs-fixer fix
或者,将配置文件命名为除 .php_cs
之外的其他名称(例如 .php_cs_myconfig
),然后运行
$ php-cs-fixer fix --config=.php_cs_myconfig