vix/phpcs-sniffs
Composer 安装命令:
composer require --dev vix/phpcs-sniffs
包简介
Custom PHP_CodeSniffer ruleset for strict development standards
README 文档
README
A comprehensive set of strict PHP_CodeSniffer rules for general PHP, Laravel, and Yii2 projects to maintain high code quality standards in your projects.
Installation
Requirements
- PHP 8.4 or higher
- Composer
Install via Composer
composer require --dev vix/phpcs-sniffs
Usage
Basic Configuration
Create a phpcs.xml file in your project root:
<?xml version="1.0"?> <ruleset name="MyProject"> <description>My project coding standard</description> <!-- Paths to check --> <file>src</file> <file>tests</file> <!-- Use VixPHPCS rules --> <rule ref="VixPHPCS"/> </ruleset>
Sniffs
The package ships with the VixPHPCS ruleset. Alternatively, individual standalone sniffs can be enabled manually. The catalog includes return-type consistency rules such as forbidding nullable bool returns in function and method signatures/docblocks. See docs/SNIFFS.md for the full catalog, examples, and configurable parameters.
Development
Guidelines
- All new sniffs must have tests
- Follow the existing code style
- Update documentation when necessary
- Ensure all checks pass (
composer testandcomposer static-analysis)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Additional Resources
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-18