automattic/phpcs-neutron-standard
Composer 安装命令:
composer require --dev automattic/phpcs-neutron-standard
包简介
A set of phpcs sniffs for modern php development.
README 文档
README
Warning
IMPORTANT NOTE: This project is no longer actively developed. At Automattic we've switched to using the WordPress Coding Standards.
These are a set of modern (PHP >7) linting guidelines meant to be applied in addition to the the WordPress coding standards 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.
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.
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-standard
If you want this standard, the WordPress standard, the VariableAnalysis standard, and other customizations, you can install the meta-standard NeutronRuleset instead.
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.
<?xml version="1.0"?> <ruleset name="MyStandard"> <description>My library.</description> <rule ref="NeutronStandard"/> </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
Guidelines
View the Guidelines here.
automattic/phpcs-neutron-standard 适用场景与选型建议
automattic/phpcs-neutron-standard 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 913.92k 次下载、GitHub Stars 达 93, 最近一次更新时间为 2017 年 12 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 automattic/phpcs-neutron-standard 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 automattic/phpcs-neutron-standard 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 913.92k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 93
- 点击次数: 17
- 依赖项目数: 27
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-12-04