generated from wickedbyte/project-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
186 lines (162 loc) · 8.13 KB
/
phpcs.xml
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
181
182
183
184
185
186
<?xml version="1.0"?>
<ruleset name="WickedByte Open Source Coding Standards"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"
>
<config name="installed_paths" value="../../slevomat/coding-standard"/>
<arg name="cache" value="build/phpcs"/>
<arg name="report" value="full"/>
<arg name="extensions" value="php"/>
<arg name="colors"/>
<arg value="spn"/>
<ini name="memory_limit" value="1G"/>
<file>src/</file>
<file>tests/</file>
<file>.psysh.php</file>
<file>tombstone.php</file>
<file>rector.php</file>
<rule ref="PSR12" />
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<!-- Zero spaces are required after the unary cast and not (!) operators -->
<rule ref="Generic.Formatting.NoSpaceAfterCast"/>
<rule ref="Generic.Formatting.SpaceAfterNot">
<properties>
<property name="spacing" value="0"/>
</properties>
</rule>
<rule ref="Generic.WhiteSpace.SpreadOperatorSpacingAfter"/>
<!-- The PHP_SAPI constant must be used instead of the php_sapi_name() method -->
<rule ref="Generic.PHP.SAPIUsage"/>
<!-- PHP files must be valid PHP syntax and pass the built-in linter -->
<rule ref="Generic.PHP.Syntax"/>
<!-- Use of the Backtick Operator (`) is Prohibited - Use \shell_exec() Instead -->
<rule ref="Generic.PHP.BacktickOperator"/>
<rule ref="Generic.PHP.RequireStrictTypes"/>
<!-- Require Trailing Commas in Multiline Arrays, Calls, and Declarations -->
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/>
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall"/>
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInClosureUse"/>
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration"/>
<!-- PHP Attribute Spacing Rules -->
<rule ref="SlevomatCodingStandard.Attributes.AttributeAndTargetSpacing">
<properties>
<property name="allowOnSameLine" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Attributes.DisallowMultipleAttributesPerLine"/>
<rule ref="SlevomatCodingStandard.Attributes.RequireAttributeAfterDocComment"/>
<rule ref="SlevomatCodingStandard.Classes.BackedEnumTypeSpacing">
<properties>
<property name="spacesCountBeforeColon" value="0"/>
<property name="spacesCountBeforeType" value="1"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.ClassMemberSpacing">
<properties>
<property name="linesCountBetweenMembers" value="1"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.ConstantSpacing">
<properties>
<property name="minLinesCountBeforeWithComment" value="0"/>
<property name="maxLinesCountBeforeWithComment" value="1"/>
<property name="minLinesCountBeforeWithoutComment" value="0"/>
<property name="maxLinesCountBeforeWithoutComment" value="1"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.EnumCaseSpacing">
<properties>
<property name="minLinesCountBeforeWithComment" value="0"/>
<property name="maxLinesCountBeforeWithComment" value="1"/>
<property name="minLinesCountBeforeWithoutComment" value="0"/>
<property name="maxLinesCountBeforeWithoutComment" value="1"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.MethodSpacing">
<properties>
<property name="minLinesCount" value="1"/>
<property name="maxLinesCount" value="1"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.PropertySpacing">
<properties>
<property name="minLinesCountBeforeWithComment" value="0"/>
<property name="maxLinesCountBeforeWithComment" value="1"/>
<property name="minLinesCountBeforeWithoutComment" value="0"/>
<property name="maxLinesCountBeforeWithoutComment" value="1"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.TraitUseSpacing">
<properties>
<property name="linesCountBeforeFirstUseWhenFirstInClass" value="0"/>
<property name="linesCountBeforeFirstUse" value="1"/>
<property name="linesCountBetweenUses" value="0"/>
<property name="linesCountAfterLastUse" value="1"/>
<property name="linesCountAfterLastUseWhenLastInClass" value="0"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing"/>
<rule ref="SlevomatCodingStandard.Functions.NamedArgumentSpacing"/>
<rule ref="SlevomatCodingStandard.Attributes.AttributeAndTargetSpacing"/>
<rule ref="SlevomatCodingStandard.Attributes.DisallowMultipleAttributesPerLine"/>
<rule ref="SlevomatCodingStandard.Attributes.RequireAttributeAfterDocComment"/>
<rule ref="SlevomatCodingStandard.Classes.ClassStructure">
<properties>
<property name="groups" type="array">
<element value="uses"/>
<element value="enum cases"/>
<element value="constants"/>
<element value="properties"/>
<element value="methods"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.PropertyDeclaration"/>
<rule ref="SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature"/>
<rule ref="SlevomatCodingStandard.Classes.TraitUseDeclaration"/>
<rule ref="SlevomatCodingStandard.Classes.UselessLateStaticBinding"/>
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment"/>
<rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses"/>
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants"/>
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions"/>
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking"/>
<!-- Enforces using shorthand cast operators, e.g. (int), forbids use of (unset) and (binary) cast operators -->
<rule ref="SlevomatCodingStandard.PHP.TypeCast"/>
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon"/>
<!-- Prohibit Duplicate Whitespace -->
<rule ref="SlevomatCodingStandard.Whitespaces.DuplicateSpaces"/>
<!-- Prohibit Duplicate Empty Lines -->
<!-- This sniff is disabled in the PSR12 standard, so we need to reset the severity -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
<severity>10</severity>
</rule>
<!-- If a file includes the strict types declaration, it must have the following spacing -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="linesCountBeforeDeclare" value="1"/>
<property name="linesCountAfterDeclare" value="1"/>
<property name="spacesCountAroundEqualsSign" value="0"/>
</properties>
</rule>
<!-- Detect left over merge conflict markers -->
<rule ref="Generic.VersionControl.GitMergeConflict"/>
<!-- Disallow Deprecated Implicitly Nullable Parameter Types (PHP 8.4)-->
<!-- https://wiki.php.net/rfc/deprecate-implicitly-nullable-types -->
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
<rule ref="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat">
<properties>
<property name="shortNullable" value="no"/>
<property name="withSpaces" value="no"/>
<property name="nullPosition" value="last"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Functions.StrictCall"/>
<rule ref="SlevomatCodingStandard.PHP.DisallowDirectMagicInvokeCall"/>
<rule ref="SlevomatCodingStandard.Whitespaces.DuplicateSpaces"/>
</ruleset>