Skip to content

Commit 583b115

Browse files
committed
Ruleset: check code style against PSR12
This commit: * Adds the complete PSR12 ruleset to this standard. * Excludes one PSR12 sniff which requires a higher minimum PHP version (PHP 7.1), than the projects in the organisation support. * Removes any individual sniff inclusions for sniffs also included in PSR12. This can be verified by running the following command which shows exactly which sniffs are included in PSR12: ```bash vendor/bin/phpcs --standard=PSR12 -e ```
1 parent a372a10 commit 583b115

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

PHPParallelLint/ruleset.xml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,33 @@
33

44
<description>A coding standard for projects in the PHP Parallel Lint organisation.</description>
55

6-
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
6+
<!--
7+
#############################################################################
8+
CHECK CODE STYLE AGAINST PSR12
9+
https://www.php-fig.org/psr/psr-12/
10+
#############################################################################
11+
-->
12+
<rule ref="PSR12">
13+
<!-- Constant visibility is a PHP 7.1 feature and cannot (yet) be used. -->
14+
<exclude name="PSR12.Properties.ConstantVisibility"/>
15+
</rule>
16+
17+
<!-- ## Sniff specific configuration for sniffs included in PSR12 ## -->
18+
19+
<rule ref="Generic.Files.LineLength">
20+
<properties>
21+
<property name="lineLimit" value="125"/>
22+
<property name="absoluteLineLimit" value="200"/>
23+
</properties>
24+
</rule>
25+
26+
27+
<!--
28+
#############################################################################
29+
MISCELLANEOUS ADDITIONAL RULES
30+
#############################################################################
31+
-->
32+
733
<rule ref="PEAR.Functions.FunctionDeclaration"/>
834
<rule ref="PEAR.Functions.FunctionCallSignature"/>
935
<rule ref="PEAR.Functions.FunctionCallSignature.Indent">
@@ -15,35 +41,23 @@
1541
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
1642
<severity>0</severity>
1743
</rule>
18-
<rule ref="PEAR.Functions.ValidDefaultValue"/>
1944

20-
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
21-
<rule ref="Generic.PHP.LowerCaseConstant"/>
2245
<rule ref="Generic.PHP.NoSilencedErrors"/>
2346
<rule ref="Squiz.PHP.GlobalKeyword"/>
2447
<rule ref="Squiz.PHP.LowercasePHPFunctions"/>
2548
<rule ref="Squiz.PHP.NonExecutableCode"/>
2649

2750
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>
2851

29-
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
3052
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace"/>
3153

3254
<rule ref="PEAR.Classes.ClassDeclaration"/>
3355

34-
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
3556
<rule ref="PEAR.ControlStructures.ControlSignature"/>
3657

37-
<rule ref="Generic.Files.LineLength">
38-
<properties>
39-
<property name="lineLimit" value="125"/>
40-
<property name="absoluteLineLimit" value="200"/>
41-
</properties>
42-
</rule>
4358
<rule ref="Zend.Files.ClosingTag"/>
4459

4560
<rule ref="Generic.NamingConventions.ConstructorName"/>
46-
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
4761

4862
<rule ref="Generic.Metrics.NestingLevel"/>
4963
<rule ref="Generic.Metrics.CyclomaticComplexity"/>

0 commit comments

Comments
 (0)