inspirecz/coding-standard-sniffs
Composer 安装命令:
composer require inspirecz/coding-standard-sniffs
包简介
INSPIRE Coding Standard Sniffs
README 文档
README
Sniffs for INSPIRE Coding Standard.
List of sniffs
Inspire.ControlStructures.DisallowHashComments 🔧
Reports and fixes hash comments in the code.
❌ $correct = false; # This is (invalid) hash comment
👍 $correct = true; // This is a valid comment
Inspire.ControlStructures.InlineCommentSpacing 🔧
Reports and fixes invalid spaces count before and after inline comment start
❌ //wrong inline comment // wrong inline comment $a = 1; //wrong inline comment (missing space after "//") $b = 2;// also wrong inline comment (missing space before "//")
👍 // correct inline comment with exactly one space after "//" $a = 1; // correct inline comment $b = 2; // correct inline comment
Inspire.ControlStructures.ControlStructureSpacing 🔧
Reports and fixes for correct spaces after control structures (exactly one space is expected, no more, no less).
❌ if($foo) { //... }
👍 if ($foo) { //... }
Inspire.ControlStructures.ClosingParenthesisOpeningCurlyBracketSameLineOnMultilineIf 🔧
Reports when closing parenthesis is not on the same line as opening curly bracket of if with multiline condition.
❌ if ( $foo && $bar ) { //...
👍 if ( $foo && $bar ) { //...
Inspire.Methods.ClosingParenthesisOpeningCurlyBracketSameLineOnMultilineMethods 🔧
Reports when closing parenthesis is not on the same line as opening curly bracket on functions and methods with multiline arguments.
❌ public function foo( int $foo, string $bar, ) { //...
👍 public function foo( int $foo, string $bar, ) { //...
Inspire.Methods.MultilineMethodArgumentsParenthesisPosition
Checks whether there is no comma immediately preceding closing parenthesis of function or method argument list.
❌ public function foo( int $foo, string $bar, ) { //...
👍 public function foo( int $foo, string $bar, ) { //...
❌ public function foo(User $user,) { //...
👍 public function foo(User $user) { //...
Inspire.Sniffs.ControlStructures.BlankLinesSniff 🔧
Forces single blank line before control structures (DO, FOR, FOREACH, IF, SWITCH, WHILE), unless they are the first statement after block opening. Contains fixer.
Inspire.Sniffs.Methods.BlankLinesBeforeReturnSniff 🔧
Forces single blank line before return statement, unless it is the first statement after block opening. Contains fixer.
Inspire.Sniffs.Methods.DisallowTracyDumpMethodsSniff
Disallows debug statements in the code.
Inspire.Sniffs.Classes.EmptyInterfaceSniff
Disallows interfaces with no methods.
inspirecz/coding-standard-sniffs 适用场景与选型建议
inspirecz/coding-standard-sniffs 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 28.15k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2018 年 09 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「standard」 「Coding Standard」 「coding」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 inspirecz/coding-standard-sniffs 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 inspirecz/coding-standard-sniffs 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 inspirecz/coding-standard-sniffs 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Adds the EDTF data type to Wikibase
Vanio Coding Standard Ruleset for PHP_CodeSniffer.
CodeSniffer ruleset for the ZettaCMS coding standard
CodeSniffer ruleset for the Superbrave coding standard
Class to generate a standard structure for api json responses
Convert and operate with FIPS codes for states, counties, etc.
统计信息
- 总下载量: 28.15k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 12
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-09-20