77 * @author Louis Linehan <louis.linehan@gmail.com>
88 * @copyright 2017 Louis Linehan
99 * @license https://github.com/louisl/CodeIgniter4-Standard/blob/master/LICENSE MIT License
10+ * @version Version 1.0.0-beta0005
11+ -->
12+ <!--
13+ Tab width is 4 spaces (for phpcs)
1014 -->
1115 <arg name =" tab-width" value =" 4" />
16+ <!--
17+ Ignore /ThirdParty/ directory. There could be a mix of styles in here.
18+ -->
1219 <arg name =" ignore" value =" */ThirdParty/*" />
20+ <!--
21+ Files MUST use UTF-8 character set encoding without BOM
22+ -->
1323 <rule ref =" Generic.Files.ByteOrderMark" />
24+ <!--
25+ Files MUST NOT have the PHP closing tag '?>' at the as the last content.
26+ Files MUST END with a single empty line.
27+ -->
1428 <rule ref =" PSR2.Files.EndFileNewline" />
29+ <!--
30+ Disallow short php open tags "<?".
31+ -->
32+ <rule ref =" Generic.PHP.DisallowShortOpenTag" />
33+ <!--
34+ Allow short php echo tags "<?=".
35+ -->
36+ <rule ref =" Generic.PHP.DisallowShortOpenTag.EchoFound" >
37+ <severity >0</severity >
38+ </rule >
39+ <!--
40+ Files MUST have a File doc block comment.
41+ - Checks tag order, format and spacing.
42+ -->
1543 <rule ref =" Generic.Commenting.DocComment" />
44+ <!--
45+ Functions MUST have a doc block comment.
46+ - Checks tag order, format and spacing.
47+ -->
1648 <rule ref =" PEAR.Commenting.FunctionComment" />
49+ <!--
50+ Checks doc block alignment.
51+ -->
1752 <rule ref =" Squiz.Commenting.DocCommentAlignment" />
53+ <!--
54+ Checks file doc block comment required tags, and order, format and spacing.
55+ -->
1856 <rule ref =" CodeIgniter4.Commenting.FileComment" >
1957 <properties >
2058 <property name =" error" value =" false" />
2159 </properties >
2260 </rule >
61+ <!--
62+ Checks class doc block comment required tags, and order, format and spacing.
63+ -->
2364 <rule ref =" CodeIgniter4.Commenting.ClassComment" />
65+ <!--
66+ for
67+ Variables that have a comment.
68+ - Checks tag order, format and spacing.
69+ -->
2470 <rule ref =" Squiz.Commenting.VariableComment" >
2571 <properties >
2672 <property name =" error" value =" false" />
2773 </properties >
2874 </rule >
75+ <!--
76+ User defined constants must be upper case.
77+ -->
2978 <rule ref =" Generic.NamingConventions.UpperCaseConstantName" />
79+ <!--
80+ Boolean or "||" must be used. Not logical "or".
81+ -->
3082 <rule ref =" CodeIgniter4.Operators.BooleanOr" />
83+ <!--
84+ Boolean and "&&" must be used. Not logical "and".
85+ -->
3186 <rule ref =" CodeIgniter4.Operators.BooleanAnd" />
87+ <!--
88+ Boolean not "!" must have a space after.
89+ -->
3290 <rule ref =" CodeIgniter4.WhiteSpace.BooleanNotSpaceAfter" />
91+ <!--
92+ Is identical "===" must be used. Not is equal "==".
93+ -->
3394 <rule ref =" CodeIgniter4.Operators.IsIdentical" />
95+ <!--
96+ Is not identical "!==" must be used. Not is not equal "!=".
97+ -->
3498 <rule ref =" CodeIgniter4.Operators.IsNotIdentical" />
99+ <!--
100+ Warning for discouraged functions.
101+ error_log
102+ print_r
103+ var_dump
104+ last_query
105+ enable_profiler
106+ -->
35107 <rule ref =" CodeIgniter4.PHP.DiscouragedFunctions" />
36- <rule ref =" Squiz.WhiteSpace.SuperfluousWhitespace" >
37- <properties >
38- <property name =" ignoreBlankLines" value =" false" />
39- </properties >
40- </rule >
41- <rule ref =" Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" >
42- <severity >0</severity >
43- </rule >
44- <rule ref =" Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" >
45- <severity >0</severity >
46- </rule >
47- <rule ref =" Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" >
48- <severity >0</severity >
49- </rule >
108+ <!--
109+ White space. (Unnecessary tabs, spaces and lines).
110+ There must not be white space at the start of the file.
111+ There must not be white space at the end of lines.
112+ There must not be white space on empty lines.
113+ There must not be white space at the start of the file.
114+ -->
115+ <rule ref =" Squiz.WhiteSpace.SuperfluousWhitespace" />
116+ <!--
117+ There should be once class per file, execept for cases where
118+ breaking this rule makes more sense.
119+ -->
50120 <rule ref =" CodeIgniter4.Files.OneClassPerFile" />
121+ <!--
122+ Checks tabs are used for indenting scopes.
123+ -->
51124 <rule ref =" Generic.WhiteSpace.ScopeIndent" >
52125 <properties >
53126 <property name =" tabIndent" value =" true" />
54127 </properties >
55128 </rule >
129+ <!--
130+ Checks tabs are used for indenting.
131+ -->
56132 <rule ref =" Generic.WhiteSpace.DisallowSpaceIndent" />
133+ <!--
134+ Checks line endings are unix "\n".
135+ -->
57136 <rule ref =" Generic.Files.LineEndings" >
58137 <properties >
59138 <property name =" eolChar" value =" \n" />
60139 </properties >
61140 </rule >
141+ <!--
142+ Checks opening function brace "{" is BsdAllman.
143+ -->
62144 <rule ref =" Generic.Functions.OpeningFunctionBraceBsdAllman" />
145+ <!--
146+ Checks control structures are BsdAllman.
147+ -->
63148 <rule ref =" CodeIgniter4.ControlStructures.AllmanControlSignature" />
149+ <!--
150+ Checks control structures are spaced properly.
151+ -->
64152 <rule ref =" CodeIgniter4.ControlStructures.ControlStructureSpacing" />
153+ <!--
154+ Checks function arguments are spaced properly.
155+ -->
65156 <rule ref =" Generic.Functions.FunctionCallArgumentSpacing" />
157+ <!--
158+ Checks visibilty is declared for method scopes.
159+ -->
66160 <rule ref =" Squiz.Scope.MethodScope" />
161+ <!--
162+ Checks scope keywords are spaced properly.
163+ -->
67164 <rule ref =" Squiz.WhiteSpace.ScopeKeywordSpacing" />
68- <rule ref =" Generic.PHP.DisallowShortOpenTag" />
165+ <!--
166+ Disallow multiple statements on one line.
167+ -->
69168 <rule ref =" Generic.Formatting.DisallowMultipleStatements" />
169+ <!--
170+ Use single quotes unless the string contains single quotes.
171+ -->
70172 <rule ref =" Squiz.Strings.DoubleQuoteUsage" />
173+ <!--
174+ Warning for lines exceeding 120 characters.
175+ -->
71176 <rule ref =" Generic.Files.LineLength" >
72177 <properties >
73178 <property name =" lineLimit" value =" 120" />
74179 <property name =" absoluteLineLimit" value =" 0" />
75180 </properties >
76181 </rule >
182+ <!--
183+ Checks function and method arguments with default values are at the
184+ end of the argument list.
185+ -->
77186 <rule ref =" PEAR.Functions.ValidDefaultValue" />
78- <rule ref =" CodeIgniter4.Functions.FunctionDeclaration" />
187+ <!--
188+ Checks single and multi-line function declarations are styled properly.
189+ -->
190+ <rule ref =" CodeIgniter4.Functions.FunctionDeclaration" />
191+ <!--
192+ Checks arguments in functions are spaced properly.
193+ -->
79194 <rule ref =" Squiz.Functions.FunctionDeclarationArgumentSpacing" >
80195 <properties >
81196 <property name =" equalsSpacing" value =" 1" />
82197 </properties >
83198 </rule >
84- <rule ref =" Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint" >
85- <severity >0</severity >
86- </rule >
87199 <!--
88200 <rule ref="Squiz.WhiteSpace.FunctionSpacing">
89201 <properties>
92204 </rule>
93205 @todo clash here.
94206 -->
207+ <!--
208+ Checks there are no blank lines after a function opening brace.
209+ -->
95210 <rule ref =" Squiz.WhiteSpace.FunctionOpeningBraceSpace" />
211+ <!--
212+ Checks there are no blank lines before a function closing brace.
213+ -->
96214 <rule ref =" CodeIgniter4.WhiteSpace.FunctionClosingBraceSpace" >
97215 <properties >
98216 <property name =" allowedLines" value =" 0" />
99217 </properties >
100218 </rule >
219+ <!--
220+ Checks for each declarations are styled properly.
221+ -->
101222 <rule ref =" Squiz.ControlStructures.ForEachLoopDeclaration" />
223+ <!--
224+ Checks for loop declarations are styled properly.
225+ -->
102226 <rule ref =" Squiz.ControlStructures.ForLoopDeclaration" />
227+ <!--
228+ Checks inline control structures and fixes with phpcbf.
229+ -->
103230 <rule ref =" Generic.ControlStructures.InlineControlStructure" />
231+ <!--
232+ Warning for todo items.
233+ -->
104234 <rule ref =" Generic.Commenting.Todo" />
235+ <!--
236+ Check concatenation spacing and if needed.
237+ -->
105238 <rule ref =" Squiz.Strings.ConcatenationSpacing" >
106239 <properties >
107240 <property name =" spacing" value =" 1" />
108241 <property name =" ignoreNewlines" value =" true" />
109242 </properties >
110243 </rule >
244+ <!--
245+ Check operator spacing.
246+ -->
111247 <rule ref =" Squiz.WhiteSpace.OperatorSpacing" >
112248 <properties >
113249 <property name =" ignoreNewlines" value =" true" />
114250 </properties >
115251 </rule >
252+ <!--
253+ Filename must match class if it contains one.
254+ -->
116255 <rule ref =" CodeIgniter4.Files.FilenameMatchesClass" />
256+ <!--
257+ Checks namespace declaration.
258+ -->
117259 <rule ref =" PSR2.Namespaces.NamespaceDeclaration" />
260+ <!--
261+ Checks use declaration.
262+ -->
118263 <rule ref =" PSR2.Namespaces.UseDeclaration" />
264+ <!--
265+ Checks PHP keywords are lower case.
266+ -->
119267 <rule ref =" Generic.PHP.LowerCaseKeyword" />
268+ <!--
269+ PHP constants "true", "false" and "null" must be lower case.
270+ -->
120271 <rule ref =" Generic.PHP.LowerCaseConstant" />
272+ <!--
273+ Checks variable names
274+ private, protected _lowerCamelCase
275+ public lowerCamelCase
276+ -->
121277 <rule ref =" Squiz.NamingConventions.ValidVariableName" />
278+ <!--
279+ Checks method names
280+ private, protected _lowerCamelCase()
281+ public lowerCamelCase() except allowed public method names.
282+ -->
122283 <rule ref =" CodeIgniter4.NamingConventions.ValidMethodName" />
123- </ruleset >
284+ </ruleset >
0 commit comments