-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
112 lines (109 loc) · 4.37 KB
/
phpcs.xml.dist
File metadata and controls
112 lines (109 loc) · 4.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?xml version="1.0" encoding="UTF-8"?>
<ruleset
name="Coding Standard"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"
>
<description>Coding Standard</description>
<!-- Display Progress -->
<arg value="p"/>
<!-- Show Ruleset -->
<arg value="s"/>
<!-- Encoding -->
<arg name="encoding" value="UTF-8"/>
<!-- Extension -->
<arg name="extensions" value="php"/>
<!-- parallel -->
<arg name="parallel" value="1"/>
<!-- Use Colorized Output -->
<arg name="colors"/>
<!-- Rule Set -->
<rule ref="PSR2"/>
<!-- preventing duplicate class name -->
<rule ref="Generic.Classes.DuplicateClassName"/>
<!-- must have line ending -->
<rule ref="Generic.Files.LineEndings"/>
<!-- array must be use short syntax array() == [] -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<!-- Path To Check -->
<!-- <file>public/index.php</file>-->
<file>src/</file>
<file>tests/</file>
<!-- Slevomat Ruleset -->
<config name="installed_paths" value="vendor/slevomat/coding-standard/SlevomatCodingStandard"/>
<!-- constant visibility -->
<rule ref="PSR12.Properties">
<properties>
<property name="UseSpacing" value="1"/>
<property name="ConstantVisibility" value="1"/>
</properties>
</rule>
<!-- constant visibility -->
<rule ref="PSR12.Properties">
<properties>
<property name="UseSpacing" value="1"/>
<property name="ConstantVisibility" value="1"/>
<property name="MethodVisibility" value="1"/>
</properties>
</rule>
<!-- detect spacing -->
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing">
<properties>
<property name="linesCountAfterLastUse" value="1"/>
<property name="linesCountBeforeFirstUse" value="1"/>
<property name="linesCountAfterLastUse" value="1"/>
<property name="linesCountBetweenUseTypes" value="0"/>
</properties>
</rule>
<!-- Require presence of declare(strict_types=1) & lines ruleset -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="declareOnFirstLine" value="false"/>
<property name="spacesCountAroundEqualsSign" value="0"/>
<property name="linesCountAfterDeclare" value="1"/>
<property name="linesCountBeforeDeclare" value="0"/>
</properties>
</rule>
<!-- Properties -->
<rule ref="SlevomatCodingStandard.Classes.PropertySpacing">
<properties>
<property name="minLinesCountBeforeWithComment" value="1"/>
<property name="maxLinesCountBeforeWithComment" value="1"/>
<property name="minLinesCountBeforeWithoutComment" value="1"/>
<property name="maxLinesCountBeforeWithoutComment" value="1"/>
</properties>
</rule>
<!-- Constant -->
<rule ref="SlevomatCodingStandard.Classes.ConstantSpacing">
<properties>
<property name="minLinesCountBeforeWithComment" value="1"/>
<property name="maxLinesCountBeforeWithComment" value="1"/>
<property name="minLinesCountBeforeWithoutComment" value="1"/>
<property name="maxLinesCountBeforeWithoutComment" value="1"/>
</properties>
</rule>
<!-- Methods -->
<rule ref="SlevomatCodingStandard.Classes.MethodSpacing">
<properties>
<property name="maxLinesCount" value="1"/>
<property name="minLinesCount" value="1"/>
</properties>
</rule>
<!-- detect unused variables -->
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable">
<properties>
<property name="ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach" value="true"/>
</properties>
</rule>
<!-- detect unused variables -->
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable">
<properties>
<property name="ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach" value="true"/>
</properties>
</rule>
<!-- we use strict! disallow equal operator, use identical for better code -->
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/>
<!-- detected unused use -->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/>
</ruleset>
<!-- end -->