egeniq/php-coding-standard
最新稳定版本:1.2.0
Composer 安装命令:
composer require egeniq/php-coding-standard
包简介
The Egeniq Coding Standard is a set of PHPCS rules that we use at Egeniq, it's based on the Doctrine project.
README 文档
README
The Egeniq Coding Standard is a set of PHP_CodeSniffer rules that we use at Egeniq. The standard is heavily based on Doctrine Coding Standard.
Installation
You can install the Egeniq coding standard as a composer dependency to your particular project. Just run the following command to add it to your project:
php composer require --dev egeniq/php-coding-standard
Then you can use it like:
vendor/bin/phpcs --standard=Egeniq /path/to/some/file/to/sniff.php
You might also do automatic fixes using phpcbf:
vendor/bin/phpcbf --standard=Egeniq /path/to/some/file/to/sniff.php
Project-level ruleset
To enable the Egeniq coding standard for your project, create a phpcs.xml.dist file with the following content:
<?xml version="1.0"?> <ruleset> <arg name="basepath" value="."/> <arg name="extensions" value="php"/> <arg name="parallel" value="80"/> <arg name="cache" value=".phpcs-cache"/> <arg name="colors"/> <!-- Ignore warnings, show progress of the run and show sniff names --> <arg value="nps"/> <!-- Directories to be checked --> <file>app</file> <file>tests</file> <!-- Include full Egeniq coding standard --> <rule ref="Egeniq"> <!-- sniffs to exclude --> <!-- by default strict types are required, but if you wish to disable this, exclude the following sniff: <exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"/> --> </rule> </ruleset>
This will enable verbatim the Egeniq coding standard with all rules included with their defaults. From now on you can just
run vendor/bin/phpcs and vendor/bin/phpcbf without any arguments 🙌.
统计信息
- 总下载量: 14.41k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-06-21