nicodinus/php-cs-fixer-config

dev-master 2022-08-24 16:08 UTC

This package is auto-updated.

Last update: 2024-09-24 20:36:38 UTC


README

License

安装

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

用法

配置

在项目的根目录下创建一个配置文件 .php-cs-fixer.dist

<?php

$config = new Nicodinus\lib\Config();

$config->getFinder()
    ->in(__DIR__ . '/lib')
    ->in(__DIR__ . '/test');

$cacheDir = \getenv('TRAVIS') ? \getenv('HOME') . '/.php-cs-fixer' : __DIR__;
$config->setCacheFile($cacheDir . '/.php_cs.cache');

return $config;

Git

.php_cs.cache(由 php-cs-fixer 使用的缓存文件)添加到 .gitignore

/vendor
/.idea
/composer.lock
/.php_cs.cache
/.phpunit.result.cache