diff options
Diffstat (limited to 'build/code_sniffer')
| -rw-r--r-- | build/code_sniffer/ruleset-minimum.xml | 3 | ||||
| -rw-r--r-- | build/code_sniffer/ruleset-php-legacy.xml | 21 | ||||
| -rw-r--r-- | build/code_sniffer/ruleset-php-strict.xml | 9 |
3 files changed, 33 insertions, 0 deletions
diff --git a/build/code_sniffer/ruleset-minimum.xml b/build/code_sniffer/ruleset-minimum.xml index 2de1fb4be4..33d0177390 100644 --- a/build/code_sniffer/ruleset-minimum.xml +++ b/build/code_sniffer/ruleset-minimum.xml @@ -9,4 +9,7 @@ <!-- All code files MUST use the Unix LF (linefeed) line ending. --> <rule ref="Generic.Files.LineEndings" /> + <!-- Tabs MUST be used for indentation --> + <rule ref="Generic.WhiteSpace.DisallowSpaceIndent" /> + </ruleset> diff --git a/build/code_sniffer/ruleset-php-legacy.xml b/build/code_sniffer/ruleset-php-legacy.xml index ed8c7e98a0..247313441d 100644 --- a/build/code_sniffer/ruleset-php-legacy.xml +++ b/build/code_sniffer/ruleset-php-legacy.xml @@ -5,9 +5,21 @@ <rule ref="./ruleset-minimum.xml" /> + <!-- "for (; bar; )" should be "while (bar)" instead --> + <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" /> + + <!-- A method MUST not only call its parent --> + <rule ref="Generic.CodeAnalysis.UselessOverridingMethod" /> + <!-- The body of each structure MUST be enclosed by braces. --> <rule ref="Generic.ControlStructures.InlineControlStructure" /> + <!-- There MUST not be more than one statement per line. --> + <rule ref="Generic.Formatting.DisallowMultipleStatements" /> + + <!-- Call-time pass-by-reference MUST not be used. --> + <rule ref="Generic.Functions.CallTimePassByReference.NotAllowed" /> + <!-- Class constants MUST be declared in all upper case with underscore separators. --> <rule ref="Generic.NamingConventions.UpperCaseConstantName" /> @@ -17,6 +29,15 @@ <!-- Method arguments with default values MUST go at the end of the argument list. --> <rule ref="PEAR.Functions.ValidDefaultValue" /> + <!-- In the argument list, there MUST NOT be a space before each comma, + and there MUST be one space after each comma. --> + <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"> + <properties> + <property name="equalsSpacing" value="1"/> + </properties> + </rule> + <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint" /> + <!-- The ?> closing tag MUST be omitted from files containing only PHP. --> <rule ref="Zend.Files.ClosingTag" /> diff --git a/build/code_sniffer/ruleset-php-strict.xml b/build/code_sniffer/ruleset-php-strict.xml index 65b6763c57..5e3c26a616 100644 --- a/build/code_sniffer/ruleset-php-strict.xml +++ b/build/code_sniffer/ruleset-php-strict.xml @@ -34,6 +34,15 @@ <!-- Functions MUST NOT contain multiple empty lines in a row --> <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" /> + <!-- Classes etc. MUST be namespaced --> + <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace" /> + + <!-- A file MUST not contain more than one class/interface --> + <rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses" /> + + <!-- Files containing classes MUST not have any side-effects --> + <rule ref="PSR1.Files.SideEffects.FoundWithSymbols" /> + <!-- When present, all use declarations MUST go after the namespace declaration. There MUST be one use keyword per declaration. There MUST be one blank line after the use block. --> |
