Skip to content

Commit 120606c

Browse files
committed
Update project style to reflect change in ruleset
1 parent fc3f399 commit 120606c

File tree

1 file changed

+71
-47
lines changed

1 file changed

+71
-47
lines changed

phpcs.xml

Lines changed: 71 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
<?xml version="1.0"?>
22
<ruleset name="Inpsyde Coding Standard">
33

4-
<description>PHP 7+ coding standards for Inpsyde WordPress projects.</description>
4+
<description>PHP 7+ coding standards for Inpsyde WordPress projects.</description>
55

66
<autoload>./Inpsyde/Helpers.php</autoload>
77
<autoload>./Inpsyde/PHPCSAliases.php</autoload>
88

99
<file>./Inpsyde/Sniffs/CodeQuality</file>
1010

11-
<!--
12-
PHP 7.0 and higher.
13-
-->
14-
<config name="testVersion" value="7.0-"/>
11+
<!--
12+
PHP 7.0 and higher.
13+
-->
14+
<config name="testVersion" value="7.0-"/>
1515

16-
<!--
17-
Arguments: colors, show progress and show sniff name.
18-
-->
19-
<arg name="colors"/>
20-
<arg value="sp"/>
16+
<!--
17+
Arguments: colors, show progress and show sniff name.
18+
-->
19+
<arg name="colors"/>
20+
<arg value="sp"/>
2121

22-
<!--
23-
PSR 2 Code style.
24-
See http://www.php-fig.org/psr/psr-2/
25-
-->
22+
<!--
23+
PSR 2 Code style.
24+
See http://www.php-fig.org/psr/psr-2/
25+
-->
2626
<rule ref="PSR2">
2727
<exclude name="Generic.Files.LineLength.TooLong"/>
2828
</rule>
2929

30-
<!--
31-
Some sanity in variables.
32-
See https://github.com/sirbrillig/phpcs-variable-analysis
33-
-->
34-
<rule ref="VariableAnalysis"/>
30+
<!--
31+
Some sanity in variables.
32+
See https://github.com/sirbrillig/phpcs-variable-analysis
33+
-->
34+
<rule ref="VariableAnalysis"/>
3535

36-
<!--
37-
Neutron standard are quality tools for PHP7 development from Automattic.
38-
See https://github.com/Automattic/phpcs-neutron-standard
39-
-->
40-
<rule ref="NeutronStandard">
41-
<exclude name="NeutronStandard.Functions.LongFunction"/>
42-
<exclude name="NeutronStandard.Functions.VariableFunctions"/>
43-
<exclude name="NeutronStandard.Functions.TypeHint"/>
44-
</rule>
36+
<!--
37+
Neutron standard are quality tools for PHP7 development from Automattic.
38+
See https://github.com/Automattic/phpcs-neutron-standard
39+
-->
40+
<rule ref="NeutronStandard">
41+
<exclude name="NeutronStandard.Functions.LongFunction"/>
42+
<exclude name="NeutronStandard.Functions.VariableFunctions"/>
43+
<exclude name="NeutronStandard.Functions.TypeHint"/>
44+
</rule>
4545

4646
<!--
4747
Some WordPress specific rules.
@@ -55,25 +55,49 @@
5555
<type>error</type>
5656
</rule>
5757

58-
<!--
59-
No commented-out code, please. Let version control do its job.
60-
-->
61-
<rule ref="Squiz.PHP.CommentedOutCode">
62-
<properties>
63-
<property name="maxPercentage" value="45"/>
64-
</properties>
65-
</rule>
58+
<!--
59+
Generic
60+
-->
61+
<rule ref="Generic.Metrics.CyclomaticComplexity">
62+
<properties>
63+
<property name="absoluteComplexity" value="50"/>
64+
</properties>
65+
</rule>
66+
<rule ref="Generic.Metrics.NestingLevel">
67+
<properties>
68+
<property name="nestingLevel" value="2"/>
69+
<property name="absoluteNestingLevel" value="4"/>
70+
</properties>
71+
</rule>
72+
<rule ref="Generic.NamingConventions.ConstructorName"/>
73+
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag"/>
74+
<rule ref="Generic.PHP.LowerCaseConstant"/>
75+
<rule ref="Squiz.Classes.LowercaseClassKeywords"/>
76+
<rule ref="Squiz.PHP.CommentedOutCode">
77+
<properties>
78+
<property name="maxPercentage" value="45"/>
79+
</properties>
80+
</rule>
81+
<rule ref="Squiz.PHP.Eval"/>
82+
<rule ref="Squiz.PHP.InnerFunctions"/>
83+
<rule ref="Squiz.PHP.LowercasePHPFunctions"/>
84+
<rule ref="Squiz.PHP.NonExecutableCode"/>
85+
<rule ref="Squiz.Scope.MemberVarScope"/>
86+
<rule ref="Squiz.Scope.StaticThisUsage"/>
6687

67-
<!--
68-
Use own styles :)
69-
-->
70-
<rule ref="./Inpsyde/Sniffs/CodeQuality/ElementNameMinimalLengthSniff.php"/>
71-
<rule ref="./Inpsyde/Sniffs/CodeQuality/ForbiddenPublicPropertySniff.php"/>
72-
<rule ref="./Inpsyde/Sniffs/CodeQuality/FunctionLengthSniff.php"/>
73-
<rule ref="./Inpsyde/Sniffs/CodeQuality/LineLengthSniff.php"/>
74-
<rule ref="./Inpsyde/Sniffs/CodeQuality/MaxNestingLevelSniff.php"/>
75-
<rule ref="./Inpsyde/Sniffs/CodeQuality/NoElseSniff.php"/>
76-
<rule ref="./Inpsyde/Sniffs/CodeQuality/NoSetterSniff.php"/>
77-
<rule ref="./Inpsyde/Sniffs/CodeQuality/PropertyPerClassLimitSniff.php"/>
88+
<!--
89+
Use own styles :)
90+
-->
91+
<rule ref="./Inpsyde/Sniffs/CodeQuality/ArgumentTypeDeclarationSniff.php"/>
92+
<rule ref="./Inpsyde/Sniffs/CodeQuality/DisallowShortOpenTagSniff.php"/>
93+
<rule ref="./Inpsyde/Sniffs/CodeQuality/ElementNameMinimalLengthSniff.php"/>
94+
<rule ref="./Inpsyde/Sniffs/CodeQuality/ForbiddenPublicPropertySniff.php"/>
95+
<rule ref="./Inpsyde/Sniffs/CodeQuality/FunctionLengthSniff.php"/>
96+
<rule ref="./Inpsyde/Sniffs/CodeQuality/HookClosureReturnSniff.php"/>
97+
<rule ref="./Inpsyde/Sniffs/CodeQuality/LineLengthSniff.php"/>
98+
<rule ref="./Inpsyde/Sniffs/CodeQuality/NoElseSniff.php"/>
99+
<rule ref="./Inpsyde/Sniffs/CodeQuality/NoSetterSniff.php"/>
100+
<rule ref="./Inpsyde/Sniffs/CodeQuality/PropertyPerClassLimitSniff.php"/>
101+
<rule ref="./Inpsyde/Sniffs/CodeQuality/ReturnTypeDeclarationSniff.php"/>
78102

79103
</ruleset>

0 commit comments

Comments
 (0)