automattic/phpcs-neutron-ruleset
Composer 安装命令:
composer require --dev automattic/phpcs-neutron-ruleset
包简介
A PHPCS meta-ruleset for WordPress development
README 文档
README
These are a set of modern (PHP >7) linting guidelines for WordPress development. Because of the newer PHP version, it is not suitable for work on Core WordPress, but may be useful for those who are not bound by PHP 5.2.
Warning
IMPORTANT NOTE: This project is no longer actively developed. At Automattic we've switched to using the WordPress Coding Standards + VariableAnalysis.
These guidelines are being developed primarily for a team within Automattic, but anyone is free to use them, suggest changes, or report bugs.
This project is a phpcs "standard" (a collection of rules or "sniffs") that can be included in any project.
This is a meta-project in that it's just a collection of rules defined in these packages with certain modifications:
Installation
To use these rules in a project which is set up using composer, we recommend using the phpcodesniffer-composer-installer library which will automatically use all installed standards in the current project with the composer type phpcodesniffer-standard when you run phpcs.
composer require --dev squizlabs/php_codesniffer dealerdirect/phpcodesniffer-composer-installer
composer require --dev automattic/phpcs-neutron-ruleset
Configuration
When installing sniff standards in a project, you edit a phpcs.xml file with the rule tag inside the ruleset tag. The ref attribute of that tag should specify a standard, category, sniff, or error code to enable. It’s also possible to use these tags to disable or modify certain rules. The official annotated file explains how to do this.
The following configuration will enable all the sniffs in this ruleset.
<?xml version="1.0"?> <ruleset name="MyStandard"> <description>My library.</description> <rule ref="NeutronRuleset"/> </ruleset>
Usage
Most editors have a phpcs plugin available, but you can also run phpcs manually. To run phpcs on a file in your project, just use the command-line as follows (the -s causes the sniff code to be shown, which is very important for learning about an error).
vendor/bin/phpcs -s src/MyProject/MyClass.php
automattic/phpcs-neutron-ruleset 适用场景与选型建议
automattic/phpcs-neutron-ruleset 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 105.81k 次下载、GitHub Stars 达 17, 最近一次更新时间为 2017 年 12 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 automattic/phpcs-neutron-ruleset 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 automattic/phpcs-neutron-ruleset 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 105.81k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 17
- 点击次数: 22
- 依赖项目数: 7
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-12-20