webimpress/coding-standard
最新稳定版本:1.4.0
Composer 安装命令:
composer require webimpress/coding-standard
包简介
Webimpress Coding Standard
README 文档
README
Installation
-
Install the module via composer by running:
$ composer require --dev webimpress/coding-standard
-
Add composer scripts into your
composer.json:"scripts": { "cs-check": "phpcs", "cs-fix": "phpcbf" }
-
Create file
phpcs.xmlin base path of your repository with content:<?xml version="1.0"?> <ruleset name="Webimpress Coding Standard" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./vendor/squizlabs/php_codesniffer/phpcs.xsd"> <rule ref="./vendor/webimpress/coding-standard/ruleset.xml"/> <!-- Paths to check --> <file>config</file> <file>src</file> <file>test</file> </ruleset>
As shown above you must define locations or files you want to be checked and fixed by code sniffer. For a reference please see: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset
Usage
-
To run checks only:
$ composer cs-check
-
To automatically fix many CS issues:
$ composer cs-fix
统计信息
- 总下载量: 1.95M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 1
- 依赖项目数: 37
- 推荐数: 0
其他信息
- 授权协议: BSD-2-Clause
- 更新时间: 2026-01-04