File: code-sniffer-ruleset.xml

package info (click to toggle)
php-phpseclib 2.0.42-1%2Bdeb12u2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,416 kB
  • sloc: php: 11,867; sh: 66; xml: 49; makefile: 25
file content (35 lines) | stat: -rw-r--r-- 1,369 bytes parent folder | download | duplicates (3)
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
<?xml version="1.0"?>
<ruleset name="phpseclib Standard">

 <description>phpseclib coding standard</description>

 <!-- We are using the PSR2 standard as a base -->
 <rule ref="PSR2">
  <!-- Exceptions due to legacy code with PHP4 compatibility -->
  <exclude name="PSR2.Classes.PropertyDeclaration.ScopeMissing" />
  <exclude name="PSR2.Classes.PropertyDeclaration.VarUsed" />
  <exclude name="Squiz.Scope.MethodScope.Missing" />

  <!-- Exceptions for backward compatibility -->
  <exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
  <exclude name="PSR2.Methods.MethodDeclaration.Underscore" />

  <!-- Exceptions for whitespacing -->
  <exclude name="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma" />
  <exclude name="PSR2.ControlStructures.SwitchDeclaration.SpaceBeforeColonCASE" />
  <exclude name="PSR2.ControlStructures.SwitchDeclaration.SpaceBeforeColonDEFAULT" />

  <!-- Other Exceptions -->
  <exclude name="Generic.Files.LineLength.TooLong" />
  <exclude name="PSR2.ControlStructures.SwitchDeclaration.TerminatingComment" />
 </rule>

 <!-- Useful additional rules follow -->

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

</ruleset>