|
1 | 1 | <?xml version="1.0"?>
|
2 |
| -<ruleset name="php-oauth-cs" |
| 2 | +<ruleset name="php-qrcode-cs" |
3 | 3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
4 | 4 | xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
|
5 |
| - <description>php-oauth rules for phpcs</description> |
| 5 | + <description>php-qrcode rules for phpcs</description> |
6 | 6 |
|
7 | 7 | <file>examples</file>
|
8 | 8 | <file>src</file>
|
9 | 9 | <file>tests</file>
|
10 | 10 |
|
| 11 | + <arg value="ps"/> |
| 12 | + <arg name="parallel" value="8"/> |
| 13 | + <!--<arg name="cache" value=".build/phpcs.cache"/>--> |
| 14 | + |
11 | 15 | <arg name="basepath" value="."/>
|
| 16 | + <arg name="extensions" value="php"/> |
12 | 17 | <arg name="tab-width" value="4"/>
|
13 | 18 |
|
14 | 19 | <rule ref="Internal.Tokenizer.Exception">
|
15 | 20 | <type>error</type>
|
16 | 21 | </rule>
|
17 | 22 |
|
| 23 | + <!-- |
| 24 | + PHPCS built-in https://tentyp.dev/library/php/phpcs/ |
| 25 | + --> |
| 26 | + |
| 27 | + <rule ref="Generic.Arrays.DisallowLongArraySyntax"/> |
| 28 | + <rule ref="Generic.Classes.DuplicateClassName"/> |
| 29 | + <rule ref="Generic.CodeAnalysis.AssignmentInCondition"/> |
| 30 | + <rule ref="Generic.CodeAnalysis.EmptyPHPStatement"/> |
| 31 | + <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/> |
| 32 | + <rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/> |
| 33 | + <rule ref="Generic.CodeAnalysis.JumbledIncrementer"/> |
| 34 | + <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/> |
| 35 | + <rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/> |
| 36 | + <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/> |
| 37 | + <rule ref="Generic.Commenting.Fixme"/> |
| 38 | + <!--<rule ref="Generic.Commenting.Todo"/>--> |
| 39 | + <rule ref="Generic.ControlStructures.InlineControlStructure"/> |
| 40 | + <rule ref="Generic.Formatting.DisallowMultipleStatements"/> |
| 41 | + <!--<rule ref="Generic.Formatting.MultipleStatementAlignment"/>--> |
| 42 | + <rule ref="Generic.Formatting.NoSpaceAfterCast"/> |
| 43 | + <rule ref="Generic.Functions.CallTimePassByReference"/> |
| 44 | + <!--<rule ref="Generic.NamingConventions.InterfaceNameSuffix"/>--> |
| 45 | + <rule ref="Generic.NamingConventions.TraitNameSuffix"/> |
| 46 | + <rule ref="Generic.PHP.BacktickOperator"/> |
| 47 | + <rule ref="Generic.PHP.CharacterBeforePHPOpeningTag"/> |
| 48 | + <rule ref="Generic.PHP.DeprecatedFunctions"/> |
| 49 | + <rule ref="Generic.PHP.DisallowAlternativePHPTags"/> |
| 50 | + <rule ref="Generic.PHP.DisallowRequestSuperglobal"/> |
| 51 | + <rule ref="Generic.PHP.DisallowShortOpenTag"/> |
| 52 | + <rule ref="Generic.PHP.DiscourageGoto"/> |
| 53 | + <rule ref="Generic.PHP.LowerCaseConstant"/> |
| 54 | + <rule ref="Generic.PHP.LowerCaseKeyword"/> |
| 55 | + <rule ref="Generic.PHP.LowerCaseType"/> |
| 56 | + <rule ref="Generic.PHP.NoSilencedErrors"/> |
| 57 | + <rule ref="Generic.PHP.RequireStrictTypes"/> |
| 58 | + <rule ref="Generic.PHP.SAPIUsage"/> |
| 59 | + <rule ref="Generic.PHP.Syntax"/> |
| 60 | + <rule ref="Generic.Strings.UnnecessaryStringConcat"/> |
| 61 | + <!--<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>--> |
| 62 | + <rule ref="Generic.WhiteSpace.IncrementDecrementSpacing"/> |
| 63 | + <rule ref="Generic.WhiteSpace.ScopeIndent"/> |
| 64 | + <rule ref="Generic.WhiteSpace.SpreadOperatorSpacingAfter"/> |
| 65 | + |
| 66 | + <rule ref="PSR2.ControlStructures.ElseIfDeclaration"/> |
| 67 | + <rule ref="PSR2.Files.ClosingTag"/> |
| 68 | + <rule ref="PSR2.Files.EndFileNewline"/> |
| 69 | + <rule ref="PSR2.Namespaces.NamespaceDeclaration"/> |
| 70 | + |
| 71 | + <!--<rule ref="PSR12.Classes.AnonClassDeclaration"/>--> |
| 72 | + <rule ref="PSR12.Classes.ClosingBrace"/> |
| 73 | + <rule ref="PSR12.Files.OpenTag"/> |
| 74 | + <rule ref="PSR12.Functions.NullableTypeDeclaration"/> |
| 75 | + |
| 76 | + |
| 77 | + <rule ref="Squiz.Arrays.ArrayBracketSpacing"/> |
| 78 | + <rule ref="Squiz.Classes.DuplicateProperty"/> |
| 79 | + <rule ref="Squiz.Classes.LowercaseClassKeywords"/> |
| 80 | + <rule ref="Squiz.Classes.SelfMemberReference"/> |
| 81 | + <rule ref="Squiz.Commenting.DocCommentAlignment"/> |
| 82 | + <rule ref="Squiz.Commenting.EmptyCatchComment"/> |
| 83 | + <!--<rule ref="Squiz.Commenting.FunctionCommentThrowTag"/>--> |
| 84 | + <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration"/> |
| 85 | + <rule ref="Squiz.ControlStructures.ForEachLoopDeclaration"/> |
| 86 | + <rule ref="Squiz.ControlStructures.ForLoopDeclaration"/> |
| 87 | + <rule ref="Squiz.ControlStructures.LowercaseDeclaration"/> |
| 88 | + <rule ref="Squiz.Formatting.OperatorBracket"/> |
| 89 | + <rule ref="Squiz.Functions.FunctionDeclaration"/> |
| 90 | + <rule ref="Squiz.Functions.FunctionDuplicateArgument"/> |
| 91 | + <rule ref="Squiz.Functions.LowercaseFunctionKeywords"/> |
| 92 | + <rule ref="Squiz.Operators.IncrementDecrementUsage"/> |
| 93 | + <rule ref="Squiz.Operators.ValidLogicalOperators"/> |
| 94 | + <rule ref="Squiz.PHP.DisallowMultipleAssignments"/> |
| 95 | + <rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/> |
| 96 | + <rule ref="Squiz.PHP.Eval"/> |
| 97 | + <rule ref="Squiz.PHP.InnerFunctions"/> |
| 98 | + <rule ref="Squiz.PHP.LowercasePHPFunctions"/> |
| 99 | + <rule ref="Squiz.PHP.NonExecutableCode"/> |
| 100 | + <rule ref="Squiz.Scope.MemberVarScope"/> |
| 101 | + <rule ref="Squiz.Scope.MethodScope"/> |
| 102 | + <rule ref="Squiz.Scope.StaticThisUsage"/> |
| 103 | + <rule ref="Squiz.Strings.DoubleQuoteUsage"/> |
| 104 | + <rule ref="Squiz.Strings.EchoedStrings"/> |
| 105 | + <rule ref="Squiz.WhiteSpace.CastSpacing"/> |
| 106 | + |
| 107 | + <rule ref="Squiz.PHP.GlobalKeyword"> |
| 108 | + <exclude-pattern>examples</exclude-pattern> |
| 109 | + </rule> |
18 | 110 |
|
19 |
| - <rule ref="Generic"> |
20 |
| - <exclude name="Generic.Arrays.DisallowShortArraySyntax" /> |
21 |
| - <exclude name="Generic.CodeAnalysis.EmptyStatement" /> |
22 |
| - <exclude name="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" /> |
23 |
| - <exclude name="Generic.CodeAnalysis.UnusedFunctionParameter" /> |
24 |
| - <exclude name="Generic.Commenting.Todo" /> |
25 |
| - <exclude name="Generic.ControlStructures.InlineControlStructure" /> |
26 |
| - <exclude name="Generic.Debug" /> |
27 |
| - <exclude name="Generic.Files.EndFileNoNewline" /> |
28 |
| - <exclude name="Generic.Files.LowercasedFilename" /> |
29 |
| - <exclude name="Generic.Formatting.SpaceBeforeCast" /> |
30 |
| - <exclude name="Generic.Functions.OpeningFunctionBraceBsdAllman" /> |
31 |
| - <exclude name="Generic.NamingConventions.AbstractClassNamePrefix" /> |
32 |
| - <exclude name="Generic.NamingConventions.CamelCapsFunctionName" /> |
33 |
| - <exclude name="Generic.PHP.ClosingPHPTag" /> |
34 |
| - <exclude name="Generic.PHP.RequireStrictTypes" /> |
35 |
| - <exclude name="Generic.PHP.UpperCaseConstant" /> |
36 |
| - <exclude name="Generic.VersionControl" /> |
37 |
| - <exclude name="Generic.WhiteSpace.DisallowTabIndent" /> |
38 |
| - <exclude name="Generic." /> |
| 111 | + <rule ref="PSR1.Files.SideEffects"> |
| 112 | + <exclude-pattern>examples</exclude-pattern> |
| 113 | + <exclude-pattern>benchmark</exclude-pattern> |
39 | 114 | </rule>
|
40 | 115 |
|
| 116 | + |
| 117 | + <!-- |
| 118 | + Configurable built-in https://github.com/squizlabs/PHP_CodeSniffer/wiki/Customisable-Sniff-Properties |
| 119 | + --> |
| 120 | + |
41 | 121 | <rule ref="Generic.ControlStructures.InlineControlStructure">
|
42 | 122 | <properties>
|
43 | 123 | <property name="error" value="true"/>
|
|
46 | 126 |
|
47 | 127 | <rule ref="Generic.Files.LineLength">
|
48 | 128 | <properties>
|
49 |
| - <property name="lineLimit" value="130" /> |
| 129 | + <property name="lineLimit" value="140" /> |
50 | 130 | <property name="absoluteLineLimit" value="160" />
|
51 | 131 | <property name="ignoreComments" value="true" />
|
52 | 132 | </properties>
|
| 133 | + <exclude-pattern>examples</exclude-pattern> |
| 134 | + </rule> |
| 135 | + |
| 136 | + <rule ref="Generic.Formatting.SpaceAfterNot"> |
| 137 | + <properties> |
| 138 | + <property name="spacing" value="0" /> |
| 139 | + </properties> |
53 | 140 | </rule>
|
54 | 141 |
|
55 | 142 | <rule ref="Generic.PHP.ForbiddenFunctions">
|
|
65 | 152 | </properties>
|
66 | 153 | </rule>
|
67 | 154 |
|
68 |
| - <rule ref="Generic.Formatting.SpaceAfterCast"> |
| 155 | + <rule ref="Generic.Strings.UnnecessaryStringConcat"> |
69 | 156 | <properties>
|
70 |
| - <property name="spacing" value="0" /> |
| 157 | + <property name="allowMultiline" value="true" /> |
71 | 158 | </properties>
|
72 | 159 | </rule>
|
73 | 160 |
|
74 |
| - <rule ref="Generic.Formatting.SpaceAfterNot"> |
| 161 | + <rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing"> |
75 | 162 | <properties>
|
76 |
| - <property name="spacing" value="0" /> |
| 163 | + <property name="ignoreNewlines" value="true" /> |
77 | 164 | </properties>
|
78 | 165 | </rule>
|
79 | 166 |
|
80 | 167 | <rule ref="Generic.WhiteSpace.ScopeIndent">
|
81 | 168 | <properties>
|
82 | 169 | <property name="tabIndent" value="true" />
|
| 170 | + <property name="ignoreIndentationTokens" type="array"> |
| 171 | + <element value="T_COMMENT"/> |
| 172 | + <element value="T_DOC_COMMENT_OPEN_TAG"/> |
| 173 | + </property> |
83 | 174 | </properties>
|
84 | 175 | </rule>
|
85 | 176 |
|
86 |
| - |
87 |
| - <rule ref="PEAR"> |
88 |
| - <exclude name="PEAR.Classes" /> |
89 |
| - <exclude name="PEAR.Commenting" /> |
90 |
| - <exclude name="PEAR.ControlStructures" /> |
91 |
| - <exclude name="PEAR.Functions.FunctionCallSignature" /> |
92 |
| - <exclude name="PEAR.Functions.FunctionDeclaration" /> |
93 |
| - <exclude name="PEAR.NamingConventions" /> |
94 |
| - <exclude name="PEAR.WhiteSpace.ScopeIndent" /> |
95 |
| - </rule> |
96 |
| - |
97 |
| - <rule ref="PEAR.Commenting.FunctionComment"> |
| 177 | + <rule ref="PSR12.ControlStructures.BooleanOperatorPlacement"> |
98 | 178 | <properties>
|
99 |
| - <property name="minimumVisibility" value="public" /> |
| 179 | + <property name="allowOnly" value="first" /> |
100 | 180 | </properties>
|
101 | 181 | </rule>
|
102 | 182 |
|
103 |
| - |
104 |
| - <rule ref="PSR2"> |
105 |
| - <exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" /> |
106 |
| - |
107 |
| - <exclude name="PSR2.Classes.ClassDeclaration" /> |
108 |
| - <exclude name="PSR2.ControlStructures.ControlStructureSpacing" /> |
109 |
| - <exclude name="PSR2.ControlStructures.SwitchDeclaration" /> |
110 |
| - <exclude name="PSR2.Methods.FunctionClosingBrace" /> |
111 |
| - <exclude name="PSR2.Namespaces.UseDeclaration.MultipleDeclarations" /> |
112 |
| - </rule> |
113 |
| - |
114 |
| - <rule ref="PSR2.Methods.MethodDeclaration.Underscore"> |
115 |
| - <type>error</type> |
116 |
| - </rule> |
117 |
| - |
118 |
| - <rule ref="PSR2.Classes.PropertyDeclaration.Underscore"> |
119 |
| - <type>error</type> |
120 |
| - </rule> |
121 |
| - |
122 |
| - |
123 |
| - <rule ref="PSR12"> |
124 |
| - <exclude name="PSR12.Classes.ClassInstantiation" /> |
125 |
| - <exclude name="PSR12.Classes.OpeningBraceSpace" /> |
126 |
| - <exclude name="PSR12.ControlStructures" /> |
127 |
| - <exclude name="PSR12.Files.FileHeader.SpacingInsideBlock" /> |
128 |
| - <exclude name="PSR12.Files.FileHeader.SpacingAfterBlock" /> |
129 |
| - <exclude name="PSR12.Functions.ReturnTypeDeclaration" /> |
130 |
| - <exclude name="PSR12.Operators.OperatorSpacing" /> |
131 |
| - <exclude name="PSR12.Traits.UseDeclaration.MultipleImport" /> |
132 |
| - </rule> |
133 |
| - |
134 | 183 | <rule ref="PSR12.Namespaces.CompoundNamespaceDepth">
|
135 | 184 | <properties>
|
136 | 185 | <property name="maxDepth" value="1" />
|
137 | 186 | </properties>
|
138 | 187 | </rule>
|
139 | 188 |
|
140 |
| - <rule ref="Squiz"> |
141 |
| - <exclude name="Squiz.Arrays.ArrayDeclaration.IndexNoNewline" /> |
142 |
| - <exclude name="Squiz.Arrays.ArrayDeclaration.MultiLineNotAllowed" /> |
143 |
| - <exclude name="Squiz.Arrays.ArrayDeclaration.SingleLineNotAllowed" /> |
144 |
| - <exclude name="Squiz.Arrays.ArrayDeclaration.ValueNoNewline" /> |
145 |
| - <exclude name="Squiz.Classes.ClassDeclaration" /> |
146 |
| - <exclude name="Squiz.Commenting" /> |
147 |
| - <exclude name="Squiz.ControlStructures.ControlSignature" /> |
148 |
| - <exclude name="Squiz.ControlStructures.ElseIfDeclaration" /> |
149 |
| - <exclude name="Squiz.ControlStructures.InlineIfDeclaration.NotSingleLine" /> |
150 |
| - <exclude name="Squiz.ControlStructures.SwitchDeclaration" /> |
151 |
| - <exclude name="Squiz.Files" /> |
152 |
| - <exclude name="Squiz.Functions" /> |
153 |
| - <exclude name="Squiz.NamingConventions.ValidVariableName.NotCamelCaps" /> |
154 |
| - <exclude name="Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps" /> |
155 |
| - <exclude name="Squiz.NamingConventions.ValidFunctionName.ScopeNotCamelCaps" /> |
156 |
| - <exclude name="Squiz.Objects.ObjectInstantiation.NotAssigned" /> |
157 |
| - <exclude name="Squiz.Operators.ComparisonOperatorUsage" /> |
158 |
| - <exclude name="Squiz.PHP.CommentedOutCode" /> |
159 |
| - <exclude name="Squiz.PHP.DisallowBooleanStatement" /> |
160 |
| - <exclude name="Squiz.PHP.DisallowComparisonAssignment" /> |
161 |
| - <exclude name="Squiz.PHP.DisallowInlineIf" /> |
162 |
| - <exclude name="Squiz.PHP.EmbeddedPhp" /> |
163 |
| - <exclude name="Squiz.Strings.ConcatenationSpacing" /> |
164 |
| - <exclude name="Squiz.WhiteSpace" /> |
165 |
| - </rule> |
166 |
| - |
167 |
| - <rule ref="Squiz.Commenting.EmptyCatchComment" /> |
168 |
| - |
169 |
| - <!-- exclude some checks for the examples--> |
170 |
| - <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace"> |
171 |
| - <exclude-pattern>examples</exclude-pattern> |
172 |
| - </rule> |
173 |
| - |
174 |
| - <rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses"> |
175 |
| - <exclude-pattern>examples</exclude-pattern> |
| 189 | + <rule ref="Squiz.Strings.ConcatenationSpacing"> |
| 190 | + <properties> |
| 191 | + <property name="ignoreNewlines" value="true" /> |
| 192 | + </properties> |
176 | 193 | </rule>
|
177 | 194 |
|
178 |
| - <rule ref="PSR1.Files.SideEffects.FoundWithSymbols"> |
179 |
| - <exclude-pattern>examples</exclude-pattern> |
| 195 | + <rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing"> |
| 196 | + <properties> |
| 197 | + <property name="ignoreNewlines" value="true" /> |
| 198 | + </properties> |
180 | 199 | </rule>
|
181 | 200 |
|
182 |
| - <rule ref="Squiz.Classes.ClassFileName.NoMatch"> |
183 |
| - <exclude-pattern>examples</exclude-pattern> |
| 201 | + <rule ref="Squiz.WhiteSpace.OperatorSpacing"> |
| 202 | + <properties> |
| 203 | + <property name="ignoreNewlines" value="true" /> |
| 204 | + </properties> |
184 | 205 | </rule>
|
185 | 206 |
|
186 |
| - <rule ref="Squiz.PHP.DiscouragedFunctions.Discouraged"> |
187 |
| - <exclude-pattern>examples</exclude-pattern> |
| 207 | + <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"> |
| 208 | + <properties> |
| 209 | + <property name="ignoreBlankLines" value="true" /> |
| 210 | + </properties> |
188 | 211 | </rule>
|
189 | 212 |
|
190 | 213 | </ruleset>
|
0 commit comments