forked from brefphp/extra-php-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.phpcs.xml.dist
142 lines (123 loc) · 5.49 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
<?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-extra</file>
<file>src</file>
<!-- 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="SlevomatCodingStandard.ControlStructures.NewWithoutParentheses"/>
<!-- 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>
<!-- 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>
<!-- More lax rules about `array` type-hints (no need to always detail what's in the array) -->
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversablePropertyTypeHintSpecification">
<severity>0</severity>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableParameterTypeHintSpecification">
<severity>0</severity>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableReturnTypeHintSpecification">
<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>
<!-- Do not enforce return types in tests else it crowds the test methods with `: void` -->
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint">
<exclude-pattern type="relative">tests/*</exclude-pattern>
</rule>
</ruleset>