|
3 | 3 |
|
4 | 4 | <description>phpseclib coding standard</description>
|
5 | 5 |
|
6 |
| - <!-- We are using the PEAR standard as a base --> |
7 |
| - <rule ref="PEAR"> |
8 |
| - <!-- Temporary exceptions to the PEAR standard follow --> |
9 |
| - <exclude name="Generic.ControlStructures.InlineControlStructure.Discouraged" /> |
10 |
| - <exclude name="Generic.Files.LineLength.TooLong" /> |
11 |
| - <exclude name="PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital" /> |
12 |
| - <exclude name="PEAR.NamingConventions.ValidFunctionName.NotCamelCaps" /> |
13 |
| - <exclude name="PEAR.Commenting.ClassComment.InvalidVersion" /> |
14 |
| - <exclude name="PEAR.Commenting.ClassComment.MissingTag" /> |
15 |
| - <exclude name="PEAR.Commenting.FileComment.EmptyCopyright" /> |
16 |
| - <exclude name="PEAR.Commenting.FileComment.InvalidVersion" /> |
17 |
| - <exclude name="PEAR.Commenting.FunctionComment.ExtraParamComment" /> |
18 |
| - <exclude name="PEAR.Commenting.FunctionComment.MissingReturn" /> |
19 |
| - <exclude name="PEAR.Commenting.FunctionComment.MissingParamComment" /> |
20 |
| - <exclude name="PEAR.Commenting.FunctionComment.MissingParamName" /> |
21 |
| - <exclude name="PEAR.Commenting.FunctionComment.MissingParamTag" /> |
22 |
| - <exclude name="PEAR.Commenting.FunctionComment.ParameterCommentsNotAligned" /> |
23 |
| - <exclude name="PEAR.Commenting.FunctionComment.ParameterNamesNotAligned" /> |
24 |
| - <exclude name="PEAR.Commenting.FunctionComment.ParamNameNoMatch" /> |
25 |
| - <exclude name="PEAR.Commenting.FunctionComment.SpacingAfterParams" /> |
26 |
| - <exclude name="PEAR.Commenting.FunctionComment.SpacingBeforeParams" /> |
27 |
| - <exclude name="PEAR.Commenting.FunctionComment.SpacingBeforeTags" /> |
28 |
| - <exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" /> |
29 |
| - <exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" /> |
30 |
| - <exclude name="PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket" /> |
31 |
| - <exclude name="PEAR.WhiteSpace.ScopeClosingBrace.BreakIdent" /> |
32 |
| - <exclude name="PEAR.WhiteSpace.ScopeClosingBrace.Indent" /> |
33 |
| - <exclude name="PEAR.WhiteSpace.ScopeClosingBrace.Line" /> |
34 |
| - <exclude name="PEAR.WhiteSpace.ScopeIndent.Incorrect" /> |
| 6 | + <!-- We are using the PSR2 standard as a base --> |
| 7 | + <rule ref="PSR2"> |
| 8 | + <!-- Exceptions due to legacy code with PHP4 compatibility --> |
| 9 | + <exclude name="PSR2.Classes.PropertyDeclaration.ScopeMissing" /> |
| 10 | + <exclude name="PSR2.Classes.PropertyDeclaration.VarUsed" /> |
| 11 | + <exclude name="Squiz.Scope.MethodScope.Missing" /> |
| 12 | + |
| 13 | + <!-- Exceptions for backward compatibility --> |
| 14 | + <exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" /> |
| 15 | + <exclude name="PSR2.Methods.MethodDeclaration.Underscore" /> |
| 16 | + |
| 17 | + <!-- Exceptions for whitespacing --> |
| 18 | + <exclude name="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma" /> |
| 19 | + <exclude name="PSR2.ControlStructures.SwitchDeclaration.SpaceBeforeColonCASE" /> |
| 20 | + <exclude name="PSR2.ControlStructures.SwitchDeclaration.SpaceBeforeColonDEFAULT" /> |
| 21 | + |
| 22 | + <!-- Other Exceptions --> |
| 23 | + <exclude name="Generic.Files.LineLength.TooLong" /> |
| 24 | + <exclude name="PSR2.ControlStructures.SwitchDeclaration.TerminatingComment" /> |
35 | 25 | </rule>
|
36 | 26 |
|
37 | 27 | <!-- Useful additional rules follow -->
|
|
42 | 32 | <!-- A method MUST not only call its parent -->
|
43 | 33 | <rule ref="Generic.CodeAnalysis.UselessOverridingMethod" />
|
44 | 34 |
|
45 |
| - <!-- All code files MUST use only UTF-8 without BOM. --> |
46 |
| - <rule ref="Generic.Files.ByteOrderMark" /> |
47 |
| - |
48 |
| - <!-- Constructors MUST be called __construct() instead of after the class. --> |
49 |
| - <rule ref="Generic.NamingConventions.ConstructorName" /> |
50 |
| - |
51 |
| - <!-- Classes etc. MUST be namespaced --> |
52 |
| - <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace" /> |
53 |
| - |
54 |
| - <!-- A file MUST not contain more than one class/interface --> |
55 |
| - <rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses" /> |
56 |
| - |
57 |
| - <!-- Files containing classes MUST not have any side-effects --> |
58 |
| - <rule ref="PSR1.Files.SideEffects.FoundWithSymbols" /> |
59 |
| - |
60 |
| - <!-- Each file MUST end with exactly one newline character --> |
61 |
| - <rule ref="PSR2.Files.EndFileNewline" /> |
62 |
| - |
63 |
| - <!-- In the argument list, there MUST NOT be a space before each comma, |
64 |
| - and there MUST be one space after each comma. --> |
65 |
| - <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"> |
66 |
| - <properties> |
67 |
| - <property name="equalsSpacing" value="1"/> |
68 |
| - </properties> |
69 |
| - </rule> |
70 |
| - <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint" /> |
71 |
| - |
72 |
| - <!-- There MUST NOT be trailing whitespace at the end of lines. --> |
73 |
| - <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" /> |
74 |
| - |
75 |
| - <!-- There MUST NOT be whitespace before the first content of a file --> |
76 |
| - <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" /> |
77 |
| - |
78 |
| - <!-- There MUST NOT be whitespace after the last content of a file --> |
79 |
| - <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" /> |
80 |
| - |
81 |
| - <!-- Functions MUST NOT contain multiple empty lines in a row --> |
82 |
| - <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" /> |
83 |
| - |
84 |
| - <!-- The ?> closing tag MUST be omitted from files containing only PHP. --> |
85 |
| - <rule ref="Zend.Files.ClosingTag" /> |
86 |
| - |
87 | 35 | </ruleset>
|
0 commit comments