10up/phpcs-composer
Composer 安装命令:
composer require 10up/phpcs-composer
包简介
10up's PHP CodeSniffer Ruleset
README 文档
README
Composer library to provide drop in installation and configuration of WPCS and PHPCompatibilityWP, setting reasonable defaults for WordPress development with nearly zero configuration.
Installation
Install the library via Composer:
$ composer require --dev 10up/phpcs-composer:"^3.0"
That's it!
Usage
Lint your PHP files with the following command:
$ ./vendor/bin/phpcs .
If relying on Composer, edited the composer.json file by adding the following:
"scripts": { "lint": [ "phpcs ." ], }
Then lint via:
$ composer run lint
Continuous Integration
PHPCS Configuration plays nicely with Continuous Integration solutions. Out of the box, the library loads the 10up-Default ruleset, and checks for syntax errors for PHP 8.2 or higher.
To override the default PHP version check, set the --runtime-set testVersion 7.0- configuration option. Example for PHP version 7.2 and above:
$ ./vendor/bin/phpcs --runtime-set testVersion 7.2-
See more information about specifying PHP version.
Note that you can only overrule PHP version check from the command-line.
IDE Integration
Some IDE integrations of PHPCS fail to register the 10up-Default ruleset. In order to rectify this, place .phpcs.xml.dist at your project root:
<?xml version="1.0"?> <ruleset name="Project Rules"> <rule ref="10up-Default" /> </ruleset>
Support Level
Active: 10up is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome.
Like what you see?
10up/phpcs-composer 适用场景与选型建议
10up/phpcs-composer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.49M 次下载、GitHub Stars 达 52, 最近一次更新时间为 2018 年 06 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 10up/phpcs-composer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 10up/phpcs-composer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.49M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 52
- 点击次数: 30
- 依赖项目数: 39
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-06-26