forked from smrealms/smr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
139 lines (110 loc) · 5.39 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
<ruleset>
<!-- Show (p)rogress and (s)niff codes. -->
<arg value="ps" />
<arg name="basepath" value="." />
<arg name="colors" />
<arg name="parallel" value="32" />
<config name="memory_limit" value="4G" />
<file>src/</file>
<file>test/</file>
<rule ref="vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml">
<!-- Do not require trait names to end in "Trait". -->
<exclude name="PSR2R.Classes.TraitName" />
<!-- We do not expect every method/class to have a docstring. -->
<exclude name="PSR2R.Commenting.DocBlock" />
<!-- We do not expect every docstring to document all params. -->
<exclude name="PSR2R.Commenting.DocBlockParam" />
<!-- Allow more compact docstrings (i.e. single line @var). -->
<exclude name="PSR2R.Commenting.DocComment" />
<!-- Erroneous sniff. Static and self are not interchangeable. -->
<exclude name="PSR2R.PHP.PreferStaticOverSelf" />
<!-- Multiple empty lines can be useful for readability. -->
<exclude name="PSR2R.WhiteSpace.EmptyLines" />
<!-- Personal preference for parentheses around require/echo. -->
<exclude name="PSR2R.WhiteSpace.LanguageConstructSpacing" />
<!-- Allow more compact property doc comments. -->
<exclude name="SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment" />
<!-- Jump statements on a single line can help keep code compact. -->
<exclude name="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing" />
<!-- Trailing comma in multi-line function calls can be misleading. -->
<exclude name="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall" />
<!-- Erroneous sniff. Disables a real language feature. -->
<exclude name="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue" />
<!-- We do not demand that all constants have a docstring. -->
<exclude name="Spryker.Commenting.DocBlockConst" />
<!-- Docstring for return void is redundant with typehint. -->
<exclude name="Spryker.Commenting.DocBlockReturnVoid" />
<!-- We do not expect that all class vars have a docstring. -->
<exclude name="Spryker.Commenting.DocBlockVar" />
<!-- Prevents compact class declarations. -->
<exclude name="Squiz.WhiteSpace.MemberVarSpacing" />
</rule>
<!-- Use more compact arrow functions, "fn()" instead of "fn ()". -->
<rule ref="SlevomatCodingStandard.Functions.ArrowFunctionDeclaration">
<properties>
<property name="spacesCountAfterKeyword" value="0" />
</properties>
</rule>
<!-- Allow more compact property doc comments. -->
<rule ref="SlevomatCodingStandard.Classes.PropertySpacing">
<properties>
<property name="minLinesCountBeforeWithComment" value="0" />
</properties>
</rule>
<!-- PHP/HTML intermixing in templates breaks indentation depth calculation. -->
<rule ref="Generic.WhiteSpace.ScopeIndent">
<exclude-pattern>src/templates/*</exclude-pattern>
</rule>
<!-- Inline control structures useful in templates for HTML formatting. -->
<rule ref="PEAR.ControlStructures.ControlSignature">
<exclude-pattern>src/templates/*</exclude-pattern>
</rule>
<rule ref="Generic.ControlStructures.InlineControlStructure">
<exclude-pattern>src/templates/*</exclude-pattern>
</rule>
<rule ref="Spryker.ControlStructures.NoInlineAssignment">
<exclude-pattern>src/templates/*</exclude-pattern>
</rule>
<!-- Some templates break the parser. -->
<rule ref="Internal.Exception">
<exclude-pattern>src/templates/*</exclude-pattern>
</rule>
<!-- Some templates will have no PHP code. -->
<rule ref="Internal.NoCodeFound">
<exclude-pattern>src/templates/*</exclude-pattern>
</rule>
<!-- Temporary until all classes are migrated to the PSR-4 autoloader. -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<severity>0</severity>
</rule>
<!-- Ignore unknown docstring tags. -->
<rule ref="PSR2R.Commenting.DocBlockTagTypes.Unknown">
<severity>0</severity>
</rule>
<!-- Ignore unknown docstring types. -->
<rule ref="Spryker.Commenting.DocBlockParamAllowDefaultValue.Typehint">
<severity>0</severity>
</rule>
<!-- This suppression allows "assignment by reference" to be written so as
to clearly indicate that it is not "assignment of a reference", i.e. to
allow "$a =& $b" instead of "$a = &$b". -->
<rule ref="PSR2R.WhiteSpace.UnaryOperatorSpacing.WrongSpace">
<severity>0</severity>
</rule>
<!-- PHPUnit convention is snake_case for test methods. -->
<rule ref="PSR1.Methods.CamelCapsMethodName">
<exclude-pattern>test/*</exclude-pattern>
</rule>
<!-- Closing tags used in templates since PHP/HTML are intermixed. -->
<rule ref="Zend.Files.ClosingTag">
<exclude-pattern>src/templates/*</exclude-pattern>
</rule>
<!-- Spryker sniffs do not support nullable typehints in docblocks.
See https://github.com/spryker/code-sniffer/issues/349. -->
<rule ref="Spryker.Commenting.DocBlockParamAllowDefaultValue.Default">
<severity>0</severity>
</rule>
<rule ref="Spryker.Commenting.DocBlockReturnNullableType.ReturnNullableMissing">
<severity>0</severity>
</rule>
</ruleset>