1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-13 11:06:03 +02:00

Merge pull request #2603 from Nicofuma/ticket/12721

[ticket/12721] Improve the code sniffer: simple rules

* Nicofuma/ticket/12721:
  [ticket/12721] Update rules descriptions
  [ticket/12721] Add Generic.NamingConventions.ConstructorName in strict
  [ticket/12721] Add Squiz.Functions.LowercaseFunctionKeywords in legacy
  [ticket/12721] Add Squiz.ControlStructures.ForLoopDeclaration in legacy
  [ticket/12721] Add Squiz.ControlStructures.ForEachLoopDeclaration
  [ticket/12721] Add Squiz.ControlStructures.ElseIfDeclaration in legacy
  [ticket/12721] Add Generic.Functions.OpeningFunctionBraceBsdAllman
  [ticket/12721] Add Squiz.Arrays.ArrayBracketSpacing in the legacy ruleset
  [ticket/12721] Add Generic.Files.LowercasedFilename in the legacy ruleset
This commit is contained in:
Andreas Fischer 2014-06-17 00:42:39 +02:00
commit 89af115071
15 changed files with 45 additions and 17 deletions

View File

@ -20,6 +20,13 @@
<!-- Call-time pass-by-reference MUST not be used. --> <!-- Call-time pass-by-reference MUST not be used. -->
<rule ref="Generic.Functions.CallTimePassByReference.NotAllowed" /> <rule ref="Generic.Functions.CallTimePassByReference.NotAllowed" />
<!-- Filenames MUST be lowercase. -->
<rule ref="Generic.Files.LowercasedFilename" />
<!-- The function brace MUST be on the line following the function declaration
and MUST be indented to the same column as the start of the function declaration. -->
<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman" />
<!-- There MUST be exactly one space after a cast. --> <!-- There MUST be exactly one space after a cast. -->
<rule ref="Generic.Formatting.SpaceAfterCast" /> <rule ref="Generic.Formatting.SpaceAfterCast" />
@ -35,6 +42,20 @@
<!-- Each file MUST end with exactly one newline character --> <!-- Each file MUST end with exactly one newline character -->
<rule ref="PSR2.Files.EndFileNewline" /> <rule ref="PSR2.Files.EndFileNewline" />
<!-- When referencing arrays there MUST NOT be any whitespace around the opening bracket
or before the closing bracket. -->
<rule ref="Squiz.Arrays.ArrayBracketSpacing" />
<!-- The "else if" statement MUST be written with a space between the words else and if. -->
<rule ref="Squiz.ControlStructures.ElseIfDeclaration" />
<!-- There MUST be a space between each element of a foreach loop. -->
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration" />
<!-- In a for loop declaration, there MUST be no space inside the brackets
and there MUST be 0 spaces before and 1 space after semicolons. -->
<rule ref="Squiz.ControlStructures.ForLoopDeclaration" />
<!-- In the argument list, there MUST NOT be a space before each comma, <!-- In the argument list, there MUST NOT be a space before each comma,
and there MUST be one space after each comma. --> and there MUST be one space after each comma. -->
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"> <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
@ -44,6 +65,9 @@
</rule> </rule>
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint" /> <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint" />
<!-- All built-in PHP functions MUST be called lowercased. -->
<rule ref="Squiz.Functions.LowercaseFunctionKeywords" />
<!-- The eval() function MUST NOT be used. --> <!-- The eval() function MUST NOT be used. -->
<rule ref="Squiz.PHP.Eval" /> <rule ref="Squiz.PHP.Eval" />

View File

@ -22,6 +22,9 @@
<!-- PHP keywords MUST be in lower case. --> <!-- PHP keywords MUST be in lower case. -->
<rule ref="Generic.PHP.LowerCaseKeyword" /> <rule ref="Generic.PHP.LowerCaseKeyword" />
<!-- Constructors MUST be called __construct() instead of after the class. -->
<rule ref="Generic.NamingConventions.ConstructorName" />
<!-- Classes etc. MUST be namespaced --> <!-- Classes etc. MUST be namespaced -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace" /> <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace" />

View File

@ -39,7 +39,8 @@ class recursive_event_filter_iterator extends \RecursiveFilterIterator
* *
* @return recursive_event_filter_iterator * @return recursive_event_filter_iterator
*/ */
public function getChildren() { public function getChildren()
{
return new self($this->getInnerIterator()->getChildren(), $this->root_path); return new self($this->getInnerIterator()->getChildren(), $this->root_path);
} }