Skip to content

Commit 7d7fe9d

Browse files
jrfnlgrogy
authored andcommitted
Ruleset: update for PHP-Code-Style 2.0
* Use the ruleset from PHP-Code-Style, but keep the custom property settings. * Set the `testVersion` for use with PHPCompatibility. * Improve the documentation in the ruleset.
1 parent 8881f01 commit 7d7fe9d

File tree

1 file changed

+11
-57
lines changed

1 file changed

+11
-57
lines changed

phpcs.xml.dist

Lines changed: 11 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHP-Parallel-Lint" xsi:noNamespaceSchemaLocation="./vendor/squizlabs/php_codesniffer/phpcs.xsd">
2+
<ruleset name="PHP-Parallel-Lint">
33
<description>PHP Parallel Lint coding standard.</description>
44

55
<!--
@@ -9,9 +9,10 @@
99
#############################################################################
1010
-->
1111

12+
<!-- Scan all files. -->
1213
<file>.</file>
1314

14-
<!-- Exclude the Examples directory and the Composer vendor directory. -->
15+
<!-- Exclude dependencies, test fixtures. -->
1516
<exclude-pattern>*/tests/examples/*</exclude-pattern>
1617
<exclude-pattern>*/vendor/*</exclude-pattern>
1718

@@ -27,77 +28,30 @@
2728
<!-- Check up to 8 files simultaneously. -->
2829
<arg name="parallel" value="8"/>
2930

31+
3032
<!--
3133
#############################################################################
32-
RULES
34+
USE THE PHPParallelLint RULESET
3335
#############################################################################
3436
-->
3537

36-
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
37-
<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
38-
<rule ref="PEAR.Functions.FunctionDeclaration"/>
39-
<rule ref="PEAR.Functions.FunctionCallSignature"/>
40-
<rule ref="PEAR.Functions.FunctionCallSignature.Indent">
41-
<severity>0</severity>
42-
</rule>
43-
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
44-
<severity>0</severity>
45-
</rule>
46-
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
47-
<severity>0</severity>
38+
<!-- Set the supported PHP versions for PHPCompatibility (included in PHPParallelLint). -->
39+
<config name="testVersion" value="5.3-"/>
40+
41+
<rule ref="PHPParallelLint">
42+
<!-- For improved readability, a blank line should be allowed before the next leaf in a if/else control structure. -->
43+
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose"/>
4844
</rule>
49-
<rule ref="PEAR.Functions.ValidDefaultValue"/>
50-
<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
5145

52-
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
53-
<rule ref="Generic.PHP.LowerCaseConstant"/>
5446
<rule ref="Generic.PHP.NoSilencedErrors">
5547
<exclude-pattern>/bin/skip-linting\.php$</exclude-pattern>
5648
</rule>
57-
<rule ref="Squiz.PHP.GlobalKeyword"/>
58-
<rule ref="Squiz.PHP.LowercasePHPFunctions"/>
59-
<rule ref="Squiz.PHP.NonExecutableCode"/>
60-
<rule ref="Generic.PHP.ForbiddenFunctions"/>
61-
<rule ref="Generic.PHP.DeprecatedFunctions"/>
62-
63-
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>
64-
65-
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
66-
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace"/>
67-
68-
<rule ref="PEAR.Classes.ClassDeclaration"/>
69-
70-
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
71-
<rule ref="PEAR.ControlStructures.ControlSignature"/>
7249

7350
<rule ref="Generic.Files.LineLength">
7451
<properties>
7552
<property name="lineLimit" value="135"/>
7653
<property name="absoluteLineLimit" value="200"/>
7754
</properties>
7855
</rule>
79-
<rule ref="Zend.Files.ClosingTag"/>
80-
<rule ref="Generic.Files.LineEndings"/>
81-
82-
<rule ref="Generic.NamingConventions.ConstructorName"/>
83-
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
84-
85-
<rule ref="Generic.Metrics.NestingLevel"/>
86-
87-
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
88-
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
89-
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
90-
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
91-
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
92-
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
93-
94-
<rule ref="PEAR.Commenting.InlineComment"/>
95-
96-
<rule ref="Generic.Formatting.SpaceAfterCast"/>
97-
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
98-
99-
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
100-
<rule ref="Squiz.ControlStructures.ElseIfDeclaration"/>
101-
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
10256

10357
</ruleset>

0 commit comments

Comments
 (0)