Skip to content

Commit a19e364

Browse files
committed
style(php): bump php version
1 parent 5a2c3f9 commit a19e364

File tree

2 files changed

+79
-57
lines changed

2 files changed

+79
-57
lines changed

codeat-phpmd.xml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
<?xml version="1.0"?>
22
<ruleset name="Standard PHPMD"
3-
xmlns="http://pmd.sf.net/ruleset/1.0.0"
4-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://pmd.sf.net/ruleset/1.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0
66
http://pmd.sf.net/ruleset_xml_schema.xsd"
77
xsi:noNamespaceSchemaLocation="
88
http://pmd.sf.net/ruleset_xml_schema.xsd">
9-
<description>
9+
<description>
1010
Standard PHPMD
1111
</description>
12-
<rule ref="rulesets/cleancode.xml" >
13-
<exclude name="ElseExpression" />
14-
<exclude name="StaticAccess" />
15-
</rule>
16-
<rule ref="rulesets/codesize.xml" />
17-
<rule ref="rulesets/design.xml" />
18-
<rule ref="rulesets/naming.xml" />
19-
<rule ref="rulesets/unusedcode.xml" >
20-
<exclude name="UnusedLocalVariable"/>
21-
<exclude name="UnusedFormalParameter" />
22-
</rule>
23-
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable">
24-
<priority>1</priority>
25-
<properties>
26-
<property name="allow-unused-foreach-variables" value="true" />
27-
</properties>
28-
</rule>
12+
13+
<rule ref="rulesets/cleancode.xml" />
14+
<rule ref="rulesets/codesize.xml" />
15+
<rule ref="rulesets/design.xml" />
16+
<rule ref="rulesets/naming.xml" />
17+
<rule ref="rulesets/unusedcode.xml" >
18+
<exclude name="UnusedLocalVariable"/>
19+
</rule>
20+
21+
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable">
22+
<priority>1</priority>
23+
<properties>
24+
<property name="allow-unused-foreach-variables" value="true" />
25+
</properties>
26+
</rule>
27+
2928
<!-- @see https://github.com/phpmd/phpmd/issues/279 -->
30-
<exclude-pattern>index.php</exclude-pattern>
29+
<exclude-pattern>index.php</exclude-pattern>
30+
3131
</ruleset>

codeat.xml

Lines changed: 58 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@
33
<description>Codeat coding standard.</description>
44
<!-- Only check PHP files. -->
55
<arg name="extensions" value="php"/>
6+
67
<!-- Treat all files as UTF-8. -->
78
<config name="encoding" value="utf-8"/>
9+
810
<!-- Show progress. -->
9-
<arg value="p"/>
10-
<exclude-pattern type="relative">^\.git/*</exclude-pattern>
11+
<arg value="p"/>
12+
13+
<exclude-pattern type="relative">^\.git/*</exclude-pattern>
1114
<exclude-pattern>/vendor/*</exclude-pattern>
1215
<exclude-pattern>/node_modules/*</exclude-pattern>
1316
<exclude-pattern>freemius</exclude-pattern>
1417
<exclude-pattern>*test*</exclude-pattern>
1518
<exclude-pattern>index.php</exclude-pattern>
19+
1620
<!-- Include some specific sniffs -->
1721
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
1822
<rule ref="Generic.Commenting.Todo"/>
@@ -25,13 +29,16 @@
2529
<rule ref="Generic.Commenting.DocComment.ContentAfterOpen"/>
2630
<rule ref="Generic.Commenting.DocComment.SpacingBeforeShort"/>
2731
<rule ref="Generic.Commenting.DocComment.ContentBeforeClose"/>
32+
2833
<!-- Check for PHP Parse errors. -->
2934
<rule ref="Generic.PHP.Syntax"/>
3035
<!-- Check for file encoding problems. -->
3136
<rule ref="Generic.Files.ByteOrderMark"/>
32-
<rule ref="Generic.Commenting.Todo"/>
33-
<rule ref="Generic.Commenting.Fixme"/>
34-
<rule ref="Zend.Files.ClosingTag"/>
37+
38+
<rule ref="Generic.Commenting.Todo"/>
39+
<rule ref="Generic.Commenting.Fixme"/>
40+
<rule ref="Zend.Files.ClosingTag"/>
41+
3542
<rule ref="Squiz.Commenting">
3643
<exclude name="Squiz.Commenting.FileComment.WrongStyle" />
3744
<exclude name="Squiz.Commenting.FileComment.SpacingAfterOpen" />
@@ -44,53 +51,60 @@
4451
<exclude name="Squiz.Commenting.FileComment.SpacingAfterComment" />
4552
<exclude name="Squiz.Commenting.BlockComment.NoEmptyLineBefore" />
4653
</rule>
54+
4755
<rule ref="Squiz.PHP">
4856
<exclude name="Squiz.PHP.DisallowMultipleAssignments.Found" />
4957
<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>
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+
6070
<rule ref="Squiz.WhiteSpace">
6171
<exclude name="Squiz.Whitespace.CastSpacing.ContainsWhiteSpace" />
6272
<exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />
6373
<exclude name="Squiz.WhiteSpace.FunctionSpacing.Before" />
6474
<exclude name="Squiz.WhiteSpace.FunctionSpacing.After" />
6575
<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" />
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" />
7080
</rule>
81+
7182
<rule ref="PEAR.NamingConventions">
7283
<exclude name="PEAR.NamingConventions.ValidClassName.Invalid" />
7384
<exclude name="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore" />
7485
<exclude name="PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps" />
75-
<exclude name="PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital" />
76-
<exclude name="PEAR.NamingConventions.ValidFunctionName.FunctionNameInvalid" />
86+
<exclude name="PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital" />
87+
<exclude name="PEAR.NamingConventions.ValidFunctionName.FunctionNameInvalid" />
7788
</rule>
78-
<rule ref="PEAR.NamingConventions">
89+
90+
<rule ref="PEAR.NamingConventions">
7991
<exclude name="PEAR.NamingConventions.ValidClassName.Invalid" />
8092
<exclude name="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore" />
8193
<exclude name="PEAR.NamingConventions.ValidFunctionName.PrivateNoUnderscore" />
8294
</rule>
95+
8396
<rule ref="PEAR.Files.IncludingFile">
8497
<exclude name="PEAR.Files.IncludingFile.BracketsNotRequired" />
8598
</rule>
99+
86100
<!-- https://github.com/wimg/PHPCompatibility/ -->
87101
<rule ref="PHPCompatibility">
88102
<exclude name="PHPCompatibility.PHP.EmptyNonVariable.Found" />
89103
<exclude name="PHPCompatibility.PHP.NewClosure.Found" />
90104
</rule>
91-
<rule ref="PHPCompatibilityWP" />
92-
<!-- Check for cross-version support for PHP 5.6 and higher. -->
105+
<!-- Check for cross-version support for PHP 5.3 and higher. -->
93106
<config name="testVersion" value="5.6"/>
107+
94108
<rule ref="WordPress">
95109
<exclude name="Generic.Files.LineEndings.InvalidEOLChar" />
96110
<exclude name="Generic.Commenting.DocComment.MissingShort" />
@@ -99,7 +113,7 @@
99113
<exclude name="PEAR.Functions.FunctionCallSignature.Indent" />
100114
<exclude name="WordPress.Arrays.ArrayKeySpacingRestrictions.NoSpacesAroundArrayKeys" />
101115
<exclude name="WordPress.Arrays.ArrayKeySpacingRestrictions.SpacesAroundArrayKeys" />
102-
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound"/>
116+
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound"/>
103117
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
104118
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
105119
<exclude name="WordPress.PHP.YodaConditions"/>
@@ -112,42 +126,49 @@
112126
<exclude name="WordPress.CSRF.NonceVerification.NoNonceVerification"/>
113127
<exclude name="WordPress.Classes.ClassInstantiation.MissingParenthesis" />
114128
</rule>
115-
<rule ref="WordPress.PHP.StrictInArray"/>
116-
<rule ref="WordPress.DB.PreparedSQLPlaceholders"/>
129+
130+
<rule ref="WordPress.PHP.StrictInArray"/>
131+
<rule ref="WordPress.DB.PreparedSQLPlaceholders"/>
117132
<rule ref="WordPress.CodeAnalysis.EmptyStatement"/>
118133
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
119-
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
120-
<rule ref="WordPress.DB.RestrictedFunctions"/>
134+
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
135+
<rule ref="WordPress.DB.RestrictedFunctions"/>
121136
<rule ref="WordPress.DB.RestrictedClasses"/>
122137
<rule ref="WordPress.PHP.DevelopmentFunctions"/>
123138
<rule ref="WordPress.PHP.DiscouragedPHPFunctions"/>
124139
<rule ref="WordPress.WP.AlternativeFunctions"/>
125140
<rule ref="WordPress.WP.DiscouragedConstants"/>
126-
<rule ref="WordPress.WP.DiscouragedFunctions"/>
127-
<rule ref="WordPress.WP.EnqueuedResources"/>
128-
<rule ref="WordPress.NamingConventions.PrefixAllGlobals"/>
141+
<rule ref="WordPress.WP.DiscouragedFunctions"/>
142+
<rule ref="WordPress.WP.EnqueuedResources"/>
143+
<rule ref="WordPress.NamingConventions.PrefixAllGlobals"/>
144+
129145
<rule ref="Wordpress-Docs">
130146
<exclude name="Squiz.Commenting.InlineComment.InvalidEndChar" />
131147
</rule>
148+
132149
<rule ref="WordPress.WP.DeprecatedClasses">
133150
<properties>
134-
<property name="minimum_supported_version" value="4.9"/>
151+
<property name="minimum_supported_version" value="4.7"/>
135152
</properties>
136153
</rule>
154+
137155
<rule ref="WordPress.WP.DeprecatedFunctions">
138156
<properties>
139-
<property name="minimum_supported_version" value="4.9"/>
157+
<property name="minimum_supported_version" value="4.7"/>
140158
</properties>
141159
</rule>
160+
142161
<rule ref="WordPress.WP.DeprecatedParameters">
143162
<properties>
144-
<property name="minimum_supported_version" value="4.9"/>
163+
<property name="minimum_supported_version" value="4.7"/>
145164
</properties>
146165
</rule>
166+
147167
<!-- Superglobal input not validated or sanitized. -->
148168
<rule ref="WordPress.Security.ValidatedSanitizedInput">
149169
<type>warning</type>
150-
</rule>
170+
</rule>
171+
151172
<rule ref="Generic.CodeAnalysis.EmptyStatement">
152173
<type>warning</type>
153174
</rule>
@@ -159,4 +180,5 @@
159180
<property name="text_domain" type="array" value="glossary-by-codeat,woo-fiscalita-italiana,genesis"/>
160181
</properties>
161182
</rule>
183+
162184
</ruleset>

0 commit comments

Comments
 (0)