forked from PHPCompatibility/PHPCompatibility
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
172 lines (143 loc) · 7.06 KB
/
phpcs.xml.dist
File metadata and controls
172 lines (143 loc) · 7.06 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?xml version="1.0"?>
<ruleset name="PHPCS Coding Standards for PHPCompatibility">
<description>Check the code of the PHPCompatibility standard itself.</description>
<arg value="sp"/>
<arg name="extensions" value="php"/>
<file>.</file>
<!-- Exclude ForbiddenNames test case code. -->
<exclude-pattern>*/PHPCompatibility/Tests/Keywords/ForbiddenNames/*\.php</exclude-pattern>
<!-- Exclude Composer vendor directory. -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>
<!-- Check up to 8 files simultanously. -->
<arg name="parallel" value="8"/>
<!--
PHP cross version compatibility ;-).
-->
<config name="testVersion" value="5.3-"/>
<rule ref="PHPCompatibility">
<!-- Exclude PHP constants back-filled by PHPCS 2.3.0+. -->
<exclude name="PHPCompatibility.Constants.NewConstants.t_trait_cFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_traitFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_insteadofFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_callableFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_finallyFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_yieldFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_ellipsisFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_powFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_pow_equalFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_coalesceFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_spaceshipFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_yield_fromFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.t_coalesce_equalFound"/>
</rule>
<!--
Minimal code style check.
-->
<rule ref="PSR2">
<!-- To address at a later point in time. -->
<exclude name="Generic.Files.LineLength.TooLong"/>
<!-- Ignoring a number of whitespace issues around blank lines. -->
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen"/>
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose"/>
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/>
</rule>
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
<exclude-pattern>*/phpunit-bootstrap\.php</exclude-pattern>
<exclude-pattern>*/PHPCSAliases\.php</exclude-pattern>
</rule>
<!-- Check that variable names are in camelCaps. -->
<rule ref="Squiz.NamingConventions.ValidVariableName">
<exclude name="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore"/>
</rule>
<!-- Check that function and method names are in camelCaps. -->
<rule ref="Generic.NamingConventions.CamelCapsFunctionName">
<properties>
<!-- Allow for two adjacent capital letters for acronyms. -->
<property name="strict" value="false"/>
</properties>
</rule>
<!-- PSR2 appears to ignore blank lines for superfluous whitespace and in several other places. Let's fix that. -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile">
<severity>5</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile">
<severity>5</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
<severity>5</severity>
</rule>
<rule ref="Generic.PHP.LowerCaseType"/>
<rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing"/>
<rule ref="PSR12.Classes.ClassInstantiation"/>
<rule ref="PSR12.Keywords.ShortFormTypeKeywords"/>
<rule ref="PSR12.Operators.OperatorSpacing"/>
<!-- Use normalized array indentation. -->
<rule ref="Generic.Arrays.ArrayIndent"/>
<rule ref="Squiz.Arrays.ArrayDeclaration"/>
<!-- Ignoring the Squiz indentation rules as normalized arrays are preferred. -->
<rule ref="Squiz.Arrays.ArrayDeclaration.KeyNotAligned">
<severity>0</severity>
</rule>
<rule ref="Squiz.Arrays.ArrayDeclaration.ValueNotAligned">
<severity>0</severity>
</rule>
<rule ref="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned">
<severity>0</severity>
</rule>
<!-- Single and multi-line arrays are both allowed. -->
<rule ref="Squiz.Arrays.ArrayDeclaration.SingleLineNotAllowed">
<severity>0</severity>
</rule>
<rule ref="Squiz.Arrays.ArrayDeclaration.MultiLineNotAllowed">
<severity>0</severity>
</rule>
<!-- All nice and good, but too much of a fuss for the outer array of nested arrays. -->
<rule ref="Squiz.Arrays.ArrayDeclaration.DoubleArrowNotAligned">
<severity>0</severity>
</rule>
<!-- Align the equal operator in assignment blocks. -->
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<properties>
<property name="maxPadding" value="25"/>
</properties>
</rule>
<rule ref="PEAR.Files.IncludingFile">
<exclude-pattern>*/phpunit-bootstrap\.php</exclude-pattern>
</rule>
<!--
Inline Documentation check.
-->
<rule ref="Generic.Commenting.DocComment">
<!-- Having a @see or @internal tag before the @param tags is fine. -->
<exclude name="Generic.Commenting.DocComment.ParamNotFirst"/>
</rule>
<!-- No need to be as strict about comment punctuation for the unit tests. -->
<rule ref="Generic.Commenting.DocComment.ShortNotCapital">
<exclude-pattern>*/PHPCompatibility/Tests/*\.php</exclude-pattern>
<exclude-pattern>*/PHPCompatibility/Util/Tests/*\.php</exclude-pattern>
</rule>
<rule ref="PEAR.Commenting">
<!-- Exclude PEAR specific tag requirements. -->
<exclude name="PEAR.Commenting.FileComment.MissingVersion" />
<exclude name="PEAR.Commenting.FileComment.MissingAuthorTag" />
<exclude name="PEAR.Commenting.FileComment.MissingCategoryTag" />
<exclude name="PEAR.Commenting.FileComment.MissingLicenseTag" />
<exclude name="PEAR.Commenting.FileComment.MissingLinkTag" />
<exclude name="PEAR.Commenting.ClassComment.MissingAuthorTag" />
<exclude name="PEAR.Commenting.ClassComment.MissingCategoryTag" />
<exclude name="PEAR.Commenting.ClassComment.MissingLicenseTag" />
<exclude name="PEAR.Commenting.ClassComment.MissingLinkTag" />
<exclude name="PEAR.Commenting.ClassComment.MissingPackageTag" />
<!-- Having a @see or @internal tag before the @category tag is fine. -->
<exclude name="PEAR.Commenting.ClassComment.CategoryTagOrder"/>
<!-- Using @since for class changelog demands multiple tags. -->
<exclude name="PEAR.Commenting.ClassComment.DuplicateSinceTag"/>
</rule>
</ruleset>