forked from brefphp/bref
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.phpcs.xml.dist
180 lines (156 loc) · 6.89 KB
/
.phpcs.xml.dist
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<?xml version="1.0"?>
<ruleset>
<arg name="basepath" value="."/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="80"/>
<arg name="cache" value=".phpcs-cache"/>
<!-- Show sniff names -->
<arg value="s"/>
<file>bref</file>
<file>src</file>
<file>tests</file>
<exclude-pattern>tests/Bridge/Symfony/var</exclude-pattern>
<exclude-pattern>tests/Bridge/Symfony/cache</exclude-pattern>
<exclude-pattern>tests/Bridge/Symfony/logs</exclude-pattern>
<exclude-pattern>tests/Bridge/Laravel/bootstrap/cache</exclude-pattern>
<!-- Import the Doctrine coding standard -->
<rule ref="Doctrine"/>
<!-- Allow long lines -->
<rule ref="Generic.Files.LineLength.TooLong">
<severity>0</severity>
</rule>
<!-- Do not align assignments -->
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<severity>0</severity>
</rule>
<!-- Require specific order of phpDoc annotations with empty newline between specific groups -->
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
<properties>
<property name="linesCountBeforeFirstContent" value="0"/>
<property name="linesCountAfterLastContent" value="0"/>
<property name="linesCountBetweenDescriptionAndAnnotations" value="1"/>
<property name="linesCountBetweenAnnotationsGroups" value="1"/>
<property name="annotationsGroups" type="array">
<element value="
@ORM\,
@ODM\,
"/>
<element value="
@param,
@return,
@throws,
"/>
<element value="
@internal,
@deprecated,
@link,
@see,
@uses,
"/>
</property>
</properties>
</rule>
<!-- Do not enforce usage of early exit -->
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit">
<severity>0</severity>
</rule>
<!-- Require new instances without parentheses when not passing parameters -->
<rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses">
<severity>0</severity>
</rule>
<rule ref="PSR12.Classes.ClassInstantiation.MissingParentheses">
<severity>0</severity>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.NewWithoutParentheses"/>
<!-- Do not require an empty line after if/for/etc. -->
<rule ref="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing.IncorrectLinesCountAfterControlStructure">
<severity>0</severity>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing.IncorrectLinesCountBeforeControlStructure">
<severity>0</severity>
</rule>
<!-- Do not require closures not referencing $this be static -->
<rule ref="SlevomatCodingStandard.Functions.StaticClosure">
<severity>0</severity>
</rule>
<!-- Allow using some absolute class name references (except global ones) -->
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
<properties>
<property name="allowFallbackGlobalConstants" value="true"/>
<property name="allowFallbackGlobalFunctions" value="true"/>
<property name="allowFullyQualifiedGlobalClasses" value="true"/>
<property name="allowFullyQualifiedGlobalConstants" value="true"/>
<property name="allowFullyQualifiedGlobalFunctions" value="true"/>
<property name="allowFullyQualifiedNameForCollidingClasses" value="true"/>
<property name="allowFullyQualifiedNameForCollidingConstants" value="true"/>
<property name="allowFullyQualifiedNameForCollidingFunctions" value="true"/>
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<!-- Require presence of declare(strict_types=1) -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<!-- Inline with the `<?php` opening tag -->
<property name="newlinesCountBetweenOpenTagAndDeclare" value="0"/>
<property name="spacesCountAroundEqualsSign" value="0"/>
<property name="newlinesCountAfterDeclare" value="2"/>
</properties>
</rule>
<!-- Declare strict type on the same line as opening tag -->
<rule ref="PSR12.Files.OpenTag.NotAlone">
<severity>0</severity>
</rule>
<!-- Require no space before colon in return types -->
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing">
<properties>
<property name="spacesCountBeforeColon" value="0"/>
</properties>
</rule>
<!-- Do not force arrays with 1 item to be inline -->
<rule ref="Squiz.Arrays.ArrayDeclaration.MultiLineNotAllowed">
<severity>0</severity>
</rule>
<!-- Do not forbid declaring functions -->
<rule ref="Squiz.Functions.GlobalFunction">
<severity>0</severity>
</rule>
<!-- Allow using variables in double quoted strings -->
<rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar">
<severity>0</severity>
</rule>
<!-- Do not force to document arrays -->
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification">
<severity>0</severity>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification">
<severity>0</severity>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification">
<severity>0</severity>
</rule>
<!-- Anonymous classes -->
<rule ref="PSR12.Classes.AnonClassDeclaration.SpaceAfterKeyword">
<severity>0</severity>
</rule>
<!-- ########################-->
<!-- TESTS -->
<!-- ########################-->
<!-- Allow underscores and non-breakable spaces to be used in tests for readability -->
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern type="relative">tests/*</exclude-pattern>
</rule>
<!-- For short anonymous classes in tests -->
<rule ref="Squiz.WhiteSpace.FunctionSpacing.Before">
<exclude-pattern type="relative">tests/*</exclude-pattern>
</rule>
<!-- Do not enforce return types in tests else it crowds the test methods with `: void` -->
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint">
<exclude-pattern type="relative">tests/*</exclude-pattern>
</rule>
<!-- ########################-->
<!-- For PHP 7.4+ only -->
<!-- ########################-->
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint">
<severity>0</severity>
</rule>
</ruleset>