|
117 | 117 | <!-- Disallow Yoda conditions. --> |
118 | 118 | <rule ref="Generic.ControlStructures.DisallowYodaConditions"/> |
119 | 119 |
|
| 120 | + <!-- Use self or static when referring to the class in use. --> |
| 121 | + <rule ref="Squiz.Classes.SelfMemberReference"/> |
| 122 | + |
| 123 | + <!-- Only one object structure per file. --> |
| 124 | + <rule ref="Generic.Files.OneObjectStructurePerFile"/> |
| 125 | + |
120 | 126 |
|
121 | 127 | <!-- |
122 | 128 | #################################################################### |
|
179 | 185 | <exclude name="PEAR.Commenting.ClassComment.DuplicateSinceTag"/> |
180 | 186 | </rule> |
181 | 187 |
|
| 188 | + |
| 189 | + <!-- |
| 190 | + #################################################################### |
| 191 | + Code Analysis additions. |
| 192 | + #################################################################### |
| 193 | + --> |
| 194 | + |
| 195 | + <!-- Efficiency: don't use function calls within the condition of a for loop. --> |
| 196 | + <rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/> |
| 197 | + |
| 198 | + <!-- Efficiency: don't use size functions within a loop. --> |
| 199 | + <rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/> |
| 200 | + |
| 201 | + <!-- Efficiency: don't unnecessarily use double quotes. --> |
| 202 | + <rule ref="Squiz.Strings.DoubleQuoteUsage.NotRequired"/> |
| 203 | + |
| 204 | + <!-- Error prevention: warns when an inner loop uses the same incrementor as the outer loop. --> |
| 205 | + <rule ref="Generic.CodeAnalysis.JumbledIncrementer"/> |
| 206 | + |
| 207 | + <!-- Error prevention: don't assign from within a condition. --> |
| 208 | + <rule ref="Generic.CodeAnalysis.AssignmentInCondition"> |
| 209 | + <exclude name="Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition"/> |
| 210 | + </rule> |
| 211 | + |
| 212 | + <!-- Clean up: remove redundant code. --> |
| 213 | + <rule ref="Squiz.PHP.NonExecutableCode"/> |
| 214 | + |
| 215 | + <!-- Clean up: no empty statements. --> |
| 216 | + <rule ref="Generic.CodeAnalysis.EmptyPHPStatement"/> |
| 217 | + |
| 218 | + <!-- Parse error prevention: guard against merge conflict artifacts. --> |
| 219 | + <rule ref="Generic.VersionControl.GitMergeConflict"/> |
| 220 | + |
182 | 221 | </ruleset> |
0 commit comments