forked from squizlabs/PHP_CodeSniffer
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
Latest commit
154 lines (137 loc) · 6.39 KB
/
Copy pathphpcs.xml.dist
File metadata and controls
154 lines (137 loc) · 6.39 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?xml version="1.0"?>
<rulesetxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"name="PHP_CodeSniffer"xsi:noNamespaceSchemaLocation="phpcs.xsd">
<description>The coding standard for PHP_CodeSniffer itself.</description>
<file>autoload.php</file>
<file>bin</file>
<file>scripts</file>
<file>src</file>
<file>tests</file>
<exclude-pattern>*/src/Standards/*/Tests/*\.(inc|css|js)$</exclude-pattern>
<exclude-pattern>*/tests/Core/*/*\.(inc|css|js)$</exclude-pattern>
<argname="basepath"value="."/>
<argname="colors"/>
<argname="parallel"value="75"/>
<argvalue="np"/>
<!-- Don't hide tokenizer exceptions -->
<ruleref="Internal.Tokenizer.Exception">
<type>error</type>
</rule>
<!-- Include the whole PEAR standard -->
<ruleref="PEAR">
<excludename="PEAR.NamingConventions.ValidFunctionName"/>
<excludename="PEAR.NamingConventions.ValidVariableName"/>
<excludename="PEAR.Commenting.ClassComment"/>
<excludename="PEAR.Commenting.FileComment.MissingCategoryTag"/>
<excludename="PEAR.Commenting.FileComment.MissingPackageTag"/>
<excludename="PEAR.Commenting.FileComment.MissingLinkTag"/>
<excludename="PEAR.Commenting.FileComment.MissingVersion"/>
<excludename="PEAR.Commenting.InlineComment"/>
</rule>
<!-- Include some sniffs from other standards that don't conflict with PEAR -->
<ruleref="Squiz.Arrays.ArrayBracketSpacing"/>
<ruleref="Squiz.Arrays.ArrayDeclaration"/>
<ruleref="Squiz.Commenting.ClosingDeclarationComment"/>
<ruleref="Squiz.ControlStructures.ControlSignature"/>
<ruleref="Squiz.ControlStructures.ElseIfDeclaration"/>
<ruleref="Squiz.Commenting.BlockComment"/>
<ruleref="Squiz.Commenting.DocCommentAlignment"/>
<ruleref="Squiz.Commenting.EmptyCatchComment"/>
<ruleref="Squiz.Commenting.InlineComment"/>
<ruleref="Squiz.Commenting.LongConditionClosingComment"/>
<ruleref="Squiz.Commenting.PostStatementComment"/>
<ruleref="Squiz.Commenting.VariableComment"/>
<ruleref="Squiz.Formatting.OperatorBracket"/>
<ruleref="Squiz.Functions.FunctionDeclarationArgumentSpacing"/>
<ruleref="Squiz.Operators.ComparisonOperatorUsage"/>
<ruleref="Squiz.PHP.DisallowInlineIf"/>
<ruleref="Squiz.Scope.MethodScope"/>
<ruleref="Squiz.Strings.ConcatenationSpacing"/>
<ruleref="Squiz.WhiteSpace.ControlStructureSpacing"/>
<ruleref="Squiz.WhiteSpace.FunctionClosingBraceSpace"/>
<ruleref="Squiz.WhiteSpace.FunctionSpacing"/>
<ruleref="Squiz.WhiteSpace.MemberVarSpacing"/>
<ruleref="Squiz.WhiteSpace.OperatorSpacing"/>
<ruleref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
<ruleref="Generic.Arrays.DisallowLongArraySyntax"/>
<ruleref="Generic.Commenting.Todo"/>
<ruleref="Generic.ControlStructures.DisallowYodaConditions"/>
<ruleref="Generic.ControlStructures.InlineControlStructure"/>
<ruleref="Generic.Formatting.DisallowMultipleStatements"/>
<ruleref="Generic.Formatting.SpaceAfterCast"/>
<ruleref="Generic.NamingConventions.ConstructorName"/>
<ruleref="Generic.PHP.DeprecatedFunctions"/>
<ruleref="Generic.PHP.LowerCaseKeyword"/>
<ruleref="Generic.Strings.UnnecessaryStringConcat"/>
<ruleref="Generic.WhiteSpace.IncrementDecrementSpacing"/>
<ruleref="PSR2.Classes.PropertyDeclaration"/>
<ruleref="PSR2.Methods.MethodDeclaration"/>
<ruleref="PSR2.Files.EndFileNewline"/>
<ruleref="PSR12.Files.OpenTag"/>
<ruleref="Zend.Files.ClosingTag"/>
<!-- PEAR uses warnings for inline control structures, so switch back to errors -->
<ruleref="Generic.ControlStructures.InlineControlStructure">
<properties>
<propertyname="error"value="true"/>
</properties>
</rule>
<!-- We use custom indent rules for arrays -->
<ruleref="Generic.Arrays.ArrayIndent"/>
<ruleref="Squiz.Arrays.ArrayDeclaration.KeyNotAligned">
<severity>0</severity>
</rule>
<ruleref="Squiz.Arrays.ArrayDeclaration.ValueNotAligned">
<severity>0</severity>
</rule>
<ruleref="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned">
<severity>0</severity>
</rule>
<ruleref="Squiz.Arrays.ArrayDeclaration.CloseBraceNewLine">
<severity>0</severity>
</rule>
<!-- Check var names, but we don't want leading underscores for private vars -->
<ruleref="Squiz.NamingConventions.ValidVariableName"/>
<ruleref="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore">
<severity>0</severity>
</rule>
<!-- Only one argument per line in multi-line function calls -->
<ruleref="PEAR.Functions.FunctionCallSignature">
<properties>
<propertyname="allowMultipleArguments"value="false"/>
</properties>
</rule>
<!-- Have 12 chars padding maximum and always show as errors -->
<ruleref="Generic.Formatting.MultipleStatementAlignment">
<properties>
<propertyname="maxPadding"value="12"/>
<propertyname="error"value="true"/>
</properties>
</rule>
<!-- Ban some functions -->
<ruleref="Generic.PHP.ForbiddenFunctions">
<properties>
<propertyname="forbiddenFunctions"type="array">
<elementkey="sizeof"value="count"/>
<elementkey="delete"value="unset"/>
<elementkey="print"value="echo"/>
<elementkey="is_null"value="null"/>
<elementkey="create_function"value="null"/>
</property>
</properties>
</rule>
<!-- Private methods MUST not be prefixed with an underscore -->
<ruleref="PSR2.Methods.MethodDeclaration.Underscore">
<type>error</type>
</rule>
<!-- Private properties MUST not be prefixed with an underscore -->
<ruleref="PSR2.Classes.PropertyDeclaration.Underscore">
<type>error</type>
</rule>
<!-- The testing bootstrap file uses string concats to stop IDEs seeing the class aliases -->
<ruleref="Generic.Strings.UnnecessaryStringConcat">
<exclude-pattern>tests/bootstrap\.php</exclude-pattern>
</rule>
<!-- This test file specifically *needs* Windows line endings for testing purposes. -->
<ruleref="Generic.Files.LineEndings.InvalidEOLChar">
<exclude-pattern>tests/Core/Tokenizer/StableCommentWhitespaceWinTest\.php</exclude-pattern>
</rule>
</ruleset>