inspirecz / coding-standard-sniffs
INSPIRE Coding Standard Sniffs
Installs: 15 888
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
- squizlabs/php_codesniffer: ^3.2
README
Sniffs for INSPIRE Coding Standard.
List of sniffs
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.