aboutsummaryrefslogtreecommitdiffstats
path: root/build/code_sniffer/ruleset-php-legacy.xml
blob: 247313441d0130b5e414c62e604921a2ef25a154 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?xml version="1.0"?>
<ruleset name="phpBB PHP Legacy Standard">

 <description>phpBB legacy coding standard for PHP files</description>

 <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" />

 <!-- Only <?php, no short tags. -->
 <rule ref="Generic.PHP.DisallowShortOpenTag.EchoFound" />

 <!-- 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" />

</ruleset>