focela/php-cs-fixer
最新稳定版本:v3.0.0
Composer 安装命令:
composer require focela/php-cs-fixer
包简介
Automatically configuration PHP CS Fixer for projects
关键字:
README 文档
README
This repository provides a base configuration
for friendsofphp/php-cs-fixer, which we use to verify and enforce a
single coding standard for PHP code.
Installation
composer require --dev focela/php-cs-fixer
Quick Start
Now that the package is installed, create a configuration file called .php_cs, .php_cs.php or .php-cs-fixer.php at
the root of your project with the following contents:
<?php // Create a new CS Fixer Finder instance $finder = PhpCsFixer\Finder::create()->in(__DIR__); return Focela\PhpCsFixer\Config::create() ->setFinder($finder);
Ignoring files and/or directories
- There will be certain situations where you might want to ignore certain files or directories to not be linted.
- Luckily, this is quite easy to achieve and all you need to do is to perform some calls on the CS Fixer Finder instance :)
- Here's a simple example where we ignore both files and directories:
<?php // Directories to not scan $excludeDirs = [ 'vendor/', ]; // Files to not scan $excludeFiles = [ 'config/app.php', ]; // Create a new CS Fixer Finder instance $finder = PhpCsFixer\Finder::create() ->in(__DIR__) ->exclude($excludeDirs) ->ignoreDotFiles(true) ->ignoreVCS(true) ->filter(function (\SplFileInfo $file) use ($excludeFiles) { return ! in_array($file->getRelativePathName(), $excludeFiles); }); return Focela\PhpCsFixer\Config::create()->setFinder($finder);
Contributing
We encourage and support an active, healthy community of contributors — including you! Details are in the contribution guide and the code of conduct. The php-cs-fixer maintainers keep an eye on issues and pull requests, but you can also report any negative conduct to opensource@focela.com. That email list is a private, safe space; even the php-cs-fixer maintainers don't have access, so don't hesitate to hold us to a high standard.
Released under the MIT License.
统计信息
- 总下载量: 2.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-24