1- <?xml version =" 1.0" ?>
1+ <?xml version =" 1.0" encoding = " UTF-8 " ?>
22<ruleset name =" Codeat" >
3- <description >Codeat coding standard.</description >
4- <!-- Only check PHP files. -->
5- <arg name =" extensions" value =" php" />
6-
7- <!-- Treat all files as UTF-8. -->
8- <config name =" encoding" value =" utf-8" />
9-
10- <!-- Show progress. -->
11- <arg value =" p" />
12-
13- <exclude-pattern type =" relative" >^\.git/*</exclude-pattern >
14- <exclude-pattern >/vendor/*</exclude-pattern >
15- <exclude-pattern >/node_modules/*</exclude-pattern >
16- <exclude-pattern >freemius</exclude-pattern >
17- <exclude-pattern >*test*</exclude-pattern >
18- <exclude-pattern >index.php</exclude-pattern >
19-
20- <!-- Include some specific sniffs -->
21- <rule ref =" Generic.CodeAnalysis.EmptyStatement" />
22- <rule ref =" Generic.Commenting.Todo" />
23- <rule ref =" Generic.Commenting.DocComment" />
24- <rule ref =" Generic.Commenting.DocComment.TagValueIndent" />
25- <rule ref =" Generic.Commenting.DocComment.ParamNotFirst" />
26- <rule ref =" Generic.Commenting.DocComment.ParamGroup" />
27- <rule ref =" Generic.Commenting.DocComment.NonParamGroup" />
28- <rule ref =" Generic.Commenting.DocComment.TagsNotGrouped" />
29- <rule ref =" Generic.Commenting.DocComment.ContentAfterOpen" />
30- <rule ref =" Generic.Commenting.DocComment.SpacingBeforeShort" />
31- <rule ref =" Generic.Commenting.DocComment.ContentBeforeClose" />
32-
33- <!-- Check for PHP Parse errors. -->
34- <rule ref =" Generic.PHP.Syntax" />
35- <!-- Check for file encoding problems. -->
36- <rule ref =" Generic.Files.ByteOrderMark" />
37-
38- <rule ref =" Generic.Commenting.Todo" />
39- <rule ref =" Generic.Commenting.Fixme" />
40- <rule ref =" Zend.Files.ClosingTag" />
41-
42- <rule ref =" Squiz.Commenting" >
43- <exclude name =" Squiz.Commenting.FileComment.WrongStyle" />
44- <exclude name =" Squiz.Commenting.FileComment.SpacingAfterOpen" />
45- <exclude name =" Squiz.Commenting.PostStatementComment.Found" />
46- <exclude name =" Squiz.Commenting.LongConditionClosingComment.Missing" />
47- <exclude name =" Squiz.Commenting.LongConditionClosingComment.Invalid" />
48- <exclude name =" Squiz.Commenting.FunctionComment.Missing" />
49- <exclude name =" Squiz.Commenting.FunctionCommentThrowTag.Missing" />
50- <exclude name =" Squiz.Commenting.FileComment.SpacingAfterOpen" />
51- <exclude name =" Squiz.Commenting.FileComment.SpacingAfterComment" />
52- <exclude name =" Squiz.Commenting.BlockComment.NoEmptyLineBefore" />
53- </rule >
54-
55- <rule ref =" Squiz.PHP" >
56- <exclude name =" Squiz.PHP.DisallowMultipleAssignments.Found" />
57- <exclude name =" Squiz.PHP.GlobalKeyword.NotAllowed" />
58- <exclude name =" Squiz.PHP.DisallowBooleanStatement.Found" />
59- <exclude name =" Squiz.PHP.DisallowInlineIf.Found" />
60- <exclude name =" Squiz.PHP.DisallowComparisonAssignment.AssignedComparison" />
61- <exclude name =" Squiz.PHP.ForbiddenFunctions.Found" />
62- </rule >
63-
64- <rule ref =" Squiz.WhiteSpace.FunctionSpacing" >
65- <properties >
66- <property name =" spacing" value =" 1" />
67- </properties >
68- </rule >
69-
70- <rule ref =" Squiz.WhiteSpace" >
71- <exclude name =" Squiz.Whitespace.CastSpacing.ContainsWhiteSpace" />
72- <exclude name =" Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />
73- <exclude name =" Squiz.WhiteSpace.FunctionSpacing.Before" />
74- <exclude name =" Squiz.WhiteSpace.FunctionSpacing.After" />
75- <exclude name =" Squiz.WhiteSpace.FunctionClosingBraceSpace.SpacingBeforeClose" />
76- <exclude name =" Squiz.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBrace" />
77- <exclude name =" Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBrace" />
78- <exclude name =" Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
79- <exclude name =" WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd" />
80- </rule >
81-
82- <rule ref =" PEAR.NamingConventions" >
83- <exclude name =" PEAR.NamingConventions.ValidClassName.Invalid" />
84- <exclude name =" PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore" />
85- <exclude name =" PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps" />
86- <exclude name =" PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital" />
87- <exclude name =" PEAR.NamingConventions.ValidFunctionName.FunctionNameInvalid" />
88- </rule >
89-
90- <rule ref =" PEAR.NamingConventions" >
91- <exclude name =" PEAR.NamingConventions.ValidClassName.Invalid" />
92- <exclude name =" PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore" />
93- <exclude name =" PEAR.NamingConventions.ValidFunctionName.PrivateNoUnderscore" />
94- </rule >
95-
96- <rule ref =" PEAR.Files.IncludingFile" >
97- <exclude name =" PEAR.Files.IncludingFile.BracketsNotRequired" />
98- </rule >
99-
100- <!-- https://github.com/wimg/PHPCompatibility/ -->
101- <rule ref =" PHPCompatibility" >
102- <exclude name =" PHPCompatibility.PHP.EmptyNonVariable.Found" />
103- <exclude name =" PHPCompatibility.PHP.NewClosure.Found" />
104- </rule >
105- <!-- Check for cross-version support for PHP 5.3 and higher. -->
106- <config name =" testVersion" value =" 5.6" />
107-
108- <rule ref =" WordPress" >
109- <exclude name =" Generic.Files.LineEndings.InvalidEOLChar" />
110- <exclude name =" Generic.Commenting.DocComment.MissingShort" />
111- <exclude name =" Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed" />
112- <exclude name =" Generic.PHP.Syntax" />
113- <exclude name =" PEAR.Functions.FunctionCallSignature.Indent" />
114- <exclude name =" WordPress.Arrays.ArrayKeySpacingRestrictions.NoSpacesAroundArrayKeys" />
115- <exclude name =" WordPress.Arrays.ArrayKeySpacingRestrictions.SpacesAroundArrayKeys" />
116- <exclude name =" WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound" />
117- <exclude name =" WordPress.Files.FileName.InvalidClassFileName" />
118- <exclude name =" WordPress.Files.FileName.NotHyphenatedLowercase" />
119- <exclude name =" WordPress.PHP.YodaConditions" />
120- <exclude name =" WordPress.Arrays.ArrayIndentation.ItemNotAligned" />
121- <exclude name =" WordPress.WP.I18n.NonSingularStringLiteralDomain" />
122- <exclude name =" WordPress.WhiteSpace.OperatorSpacing.NoSpaceAfter" />
123- <exclude name =" WordPress.Arrays.ArrayDeclaration.NoComma" />
124- <exclude name =" WordPress.Arrays.ArrayIndentation.CloseBraceNotAligned" />
125- <exclude name =" WordPress.Arrays.ArrayIndentation.CloseBraceNotAligned" />
126- <exclude name =" WordPress.CSRF.NonceVerification.NoNonceVerification" />
127- <exclude name =" WordPress.Classes.ClassInstantiation.MissingParenthesis" />
128- </rule >
129-
130- <rule ref =" WordPress.PHP.StrictInArray" />
131- <rule ref =" WordPress.DB.PreparedSQLPlaceholders" />
132- <rule ref =" WordPress.CodeAnalysis.EmptyStatement" />
133- <rule ref =" Generic.CodeAnalysis.ForLoopWithTestFunctionCall" />
134- <rule ref =" Generic.CodeAnalysis.UnconditionalIfStatement" />
135- <rule ref =" WordPress.DB.RestrictedFunctions" />
136- <rule ref =" WordPress.DB.RestrictedClasses" />
137- <rule ref =" WordPress.PHP.DevelopmentFunctions" />
138- <rule ref =" WordPress.PHP.DiscouragedPHPFunctions" />
139- <rule ref =" WordPress.WP.AlternativeFunctions" />
140- <rule ref =" WordPress.WP.DiscouragedConstants" />
141- <rule ref =" WordPress.WP.DiscouragedFunctions" />
142- <rule ref =" WordPress.WP.EnqueuedResources" />
143- <rule ref =" WordPress.NamingConventions.PrefixAllGlobals" />
144-
145- <rule ref =" Wordpress-Docs" >
146- <exclude name =" Squiz.Commenting.InlineComment.InvalidEndChar" />
147- </rule >
148-
149- <rule ref =" WordPress.WP.DeprecatedClasses" >
150- <properties >
151- <property name =" minimum_supported_version" value =" 4.7" />
152- </properties >
153- </rule >
154-
155- <rule ref =" WordPress.WP.DeprecatedFunctions" >
156- <properties >
157- <property name =" minimum_supported_version" value =" 4.7" />
158- </properties >
159- </rule >
160-
161- <rule ref =" WordPress.WP.DeprecatedParameters" >
162- <properties >
163- <property name =" minimum_supported_version" value =" 4.7" />
164- </properties >
165- </rule >
166-
167- <!-- Superglobal input not validated or sanitized. -->
168- <rule ref =" WordPress.Security.ValidatedSanitizedInput" >
169- <type >warning</type >
170- </rule >
171-
172- <rule ref =" Generic.CodeAnalysis.EmptyStatement" >
173- <type >warning</type >
174- </rule >
175- <rule ref =" Squiz.PHP.DisallowSizeFunctionsInLoops" >
176- <type >warning</type >
177- </rule >
178- <rule ref =" WordPress.WP.I18n" >
179- <properties >
180- <property name =" text_domain" type =" array" value =" glossary-by-codeat,woo-fiscalita-italiana,genesis" />
181- </properties >
182- </rule >
183-
184- </ruleset >
3+ <description >Codeat coding standard.</description >
4+ <!-- Only check PHP files. -->
5+ <arg name =" extensions" value =" php" />
6+ <!-- Treat all files as UTF-8. -->
7+ <config name =" encoding" value =" utf-8" />
8+ <!-- Show progress. -->
9+ <arg value =" p" />
10+ <exclude-pattern type =" relative" >^\.git/*</exclude-pattern >
11+ <exclude-pattern >/vendor/*</exclude-pattern >
12+ <exclude-pattern >/node_modules/*</exclude-pattern >
13+ <exclude-pattern >freemius</exclude-pattern >
14+ <exclude-pattern >*test*</exclude-pattern >
15+ <exclude-pattern >index.php</exclude-pattern >
16+ <!-- Include some specific sniffs -->
17+ <rule ref =" Generic.CodeAnalysis.EmptyStatement" />
18+ <rule ref =" Generic.Commenting.Todo" />
19+ <rule ref =" Generic.Commenting.DocComment" />
20+ <rule ref =" Generic.Commenting.DocComment.TagValueIndent" />
21+ <rule ref =" Generic.Commenting.DocComment.ParamNotFirst" />
22+ <rule ref =" Generic.Commenting.DocComment.ParamGroup" />
23+ <rule ref =" Generic.Commenting.DocComment.NonParamGroup" />
24+ <rule ref =" Generic.Commenting.DocComment.TagsNotGrouped" />
25+ <rule ref =" Generic.Commenting.DocComment.ContentAfterOpen" />
26+ <rule ref =" Generic.Commenting.DocComment.SpacingBeforeShort" />
27+ <rule ref =" Generic.Commenting.DocComment.ContentBeforeClose" />
28+ <!-- Check for PHP Parse errors. -->
29+ <rule ref =" Generic.PHP.Syntax" />
30+ <!-- Check for file encoding problems. -->
31+ <rule ref =" Generic.Files.ByteOrderMark" />
32+ <rule ref =" Generic.Commenting.Todo" />
33+ <rule ref =" Generic.Commenting.Fixme" />
34+ <rule ref =" Zend.Files.ClosingTag" />
35+ <rule ref =" Squiz.Commenting" >
36+ <exclude name =" Squiz.Commenting.FileComment.WrongStyle" />
37+ <exclude name =" Squiz.Commenting.FileComment.SpacingAfterOpen" />
38+ <exclude name =" Squiz.Commenting.PostStatementComment.Found" />
39+ <exclude name =" Squiz.Commenting.LongConditionClosingComment.Missing" />
40+ <exclude name =" Squiz.Commenting.LongConditionClosingComment.Invalid" />
41+ <exclude name =" Squiz.Commenting.FunctionComment.Missing" />
42+ <exclude name =" Squiz.Commenting.FunctionCommentThrowTag.Missing" />
43+ <exclude name =" Squiz.Commenting.FileComment.SpacingAfterOpen" />
44+ <exclude name =" Squiz.Commenting.FileComment.SpacingAfterComment" />
45+ <exclude name =" Squiz.Commenting.BlockComment.NoEmptyLineBefore" />
46+ </rule >
47+ <rule ref =" Squiz.PHP" >
48+ <exclude name =" Squiz.PHP.DisallowMultipleAssignments.Found" />
49+ <exclude name =" Squiz.PHP.GlobalKeyword.NotAllowed" />
50+ <exclude name =" Squiz.PHP.DisallowBooleanStatement.Found" />
51+ <exclude name =" Squiz.PHP.DisallowInlineIf.Found" />
52+ <exclude name =" Squiz.PHP.DisallowComparisonAssignment.AssignedComparison" />
53+ <exclude name =" Squiz.PHP.ForbiddenFunctions.Found" />
54+ </rule >
55+ <rule ref =" Squiz.WhiteSpace.FunctionSpacing" >
56+ <properties >
57+ <property name =" spacing" value =" 1" />
58+ </properties >
59+ </rule >
60+ <rule ref =" Squiz.WhiteSpace" >
61+ <exclude name =" Squiz.Whitespace.CastSpacing.ContainsWhiteSpace" />
62+ <exclude name =" Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />
63+ <exclude name =" Squiz.WhiteSpace.FunctionSpacing.Before" />
64+ <exclude name =" Squiz.WhiteSpace.FunctionSpacing.After" />
65+ <exclude name =" Squiz.WhiteSpace.FunctionClosingBraceSpace.SpacingBeforeClose" />
66+ <exclude name =" Squiz.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBrace" />
67+ <exclude name =" Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBrace" />
68+ <exclude name =" Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
69+ <exclude name =" WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd" />
70+ </rule >
71+ <rule ref =" PEAR.NamingConventions" >
72+ <exclude name =" PEAR.NamingConventions.ValidClassName.Invalid" />
73+ <exclude name =" PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore" />
74+ <exclude name =" PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps" />
75+ <exclude name =" PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital" />
76+ <exclude name =" PEAR.NamingConventions.ValidFunctionName.FunctionNameInvalid" />
77+ </rule >
78+ <rule ref =" PEAR.NamingConventions" >
79+ <exclude name =" PEAR.NamingConventions.ValidClassName.Invalid" />
80+ <exclude name =" PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore" />
81+ <exclude name =" PEAR.NamingConventions.ValidFunctionName.PrivateNoUnderscore" />
82+ </rule >
83+ <rule ref =" PEAR.Files.IncludingFile" >
84+ <exclude name =" PEAR.Files.IncludingFile.BracketsNotRequired" />
85+ </rule >
86+ <!-- https://github.com/wimg/PHPCompatibility/ -->
87+ <rule ref =" PHPCompatibility" >
88+ <exclude name =" PHPCompatibility.PHP.EmptyNonVariable.Found" />
89+ <exclude name =" PHPCompatibility.PHP.NewClosure.Found" />
90+ </rule >
91+ <!-- Check for cross-version support for PHP 5.3 and higher. -->
92+ <config name =" testVersion" value =" 5.6" />
93+ <rule ref =" WordPress" >
94+ <exclude name =" Generic.Files.LineEndings.InvalidEOLChar" />
95+ <exclude name =" Generic.Commenting.DocComment.MissingShort" />
96+ <exclude name =" Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed" />
97+ <exclude name =" Generic.PHP.Syntax" />
98+ <exclude name =" PEAR.Functions.FunctionCallSignature.Indent" />
99+ <exclude name =" WordPress.Arrays.ArrayKeySpacingRestrictions.NoSpacesAroundArrayKeys" />
100+ <exclude name =" WordPress.Arrays.ArrayKeySpacingRestrictions.SpacesAroundArrayKeys" />
101+ <exclude name =" WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound" />
102+ <exclude name =" WordPress.Files.FileName.InvalidClassFileName" />
103+ <exclude name =" WordPress.Files.FileName.NotHyphenatedLowercase" />
104+ <exclude name =" WordPress.PHP.YodaConditions" />
105+ <exclude name =" WordPress.Arrays.ArrayIndentation.ItemNotAligned" />
106+ <exclude name =" WordPress.WP.I18n.NonSingularStringLiteralDomain" />
107+ <exclude name =" WordPress.WhiteSpace.OperatorSpacing.NoSpaceAfter" />
108+ <exclude name =" WordPress.Arrays.ArrayDeclaration.NoComma" />
109+ <exclude name =" WordPress.Arrays.ArrayIndentation.CloseBraceNotAligned" />
110+ <exclude name =" WordPress.Arrays.ArrayIndentation.CloseBraceNotAligned" />
111+ <exclude name =" WordPress.CSRF.NonceVerification.NoNonceVerification" />
112+ <exclude name =" WordPress.Classes.ClassInstantiation.MissingParenthesis" />
113+ </rule >
114+ <rule ref =" WordPress.PHP.StrictInArray" />
115+ <rule ref =" WordPress.DB.PreparedSQLPlaceholders" />
116+ <rule ref =" WordPress.CodeAnalysis.EmptyStatement" />
117+ <rule ref =" Generic.CodeAnalysis.ForLoopWithTestFunctionCall" />
118+ <rule ref =" Generic.CodeAnalysis.UnconditionalIfStatement" />
119+ <rule ref =" WordPress.DB.RestrictedFunctions" />
120+ <rule ref =" WordPress.DB.RestrictedClasses" />
121+ <rule ref =" WordPress.PHP.DevelopmentFunctions" />
122+ <rule ref =" WordPress.PHP.DiscouragedPHPFunctions" />
123+ <rule ref =" WordPress.WP.AlternativeFunctions" />
124+ <rule ref =" WordPress.WP.DiscouragedConstants" />
125+ <rule ref =" WordPress.WP.DiscouragedFunctions" />
126+ <rule ref =" WordPress.WP.EnqueuedResources" />
127+ <rule ref =" WordPress.NamingConventions.PrefixAllGlobals" />
128+ <rule ref =" Wordpress-Docs" >
129+ <exclude name =" Squiz.Commenting.InlineComment.InvalidEndChar" />
130+ </rule >
131+ <rule ref =" WordPress.WP.DeprecatedClasses" >
132+ <properties >
133+ <property name =" minimum_supported_version" value =" 4.7" />
134+ </properties >
135+ </rule >
136+ <rule ref =" WordPress.WP.DeprecatedFunctions" >
137+ <properties >
138+ <property name =" minimum_supported_version" value =" 4.7" />
139+ </properties >
140+ </rule >
141+ <rule ref =" WordPress.WP.DeprecatedParameters" >
142+ <properties >
143+ <property name =" minimum_supported_version" value =" 4.7" />
144+ </properties >
145+ </rule >
146+ <!-- Superglobal input not validated or sanitized. -->
147+ <rule ref =" WordPress.Security.ValidatedSanitizedInput" >
148+ <type >warning</type >
149+ </rule >
150+ <rule ref =" Generic.CodeAnalysis.EmptyStatement" >
151+ <type >warning</type >
152+ </rule >
153+ <rule ref =" Squiz.PHP.DisallowSizeFunctionsInLoops" >
154+ <type >warning</type >
155+ </rule >
156+ <rule ref =" WordPress.WP.I18n" >
157+ <properties >
158+ <property name =" text_domain" type =" array" value =" glossary-by-codeat,woo-fiscalita-italiana,genesis" />
159+ </properties >
160+ </rule >
161+ </ruleset >
0 commit comments