-
Notifications
You must be signed in to change notification settings - Fork 16
/
phpcs.xml
151 lines (124 loc) · 6.28 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
<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" />
<!-- 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" />
<!-- Erroneous sniff. Disables a real language feature. -->
<exclude name="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue" />
<!-- We do not demand that all constants have a docstring. -->
<exclude name="PhpCollective.Commenting.DocBlockConst" />
<!-- Docstring for return void is redundant with typehint. -->
<exclude name="PhpCollective.Commenting.DocBlockReturnVoid" />
<!-- Prevents compact class declarations. -->
<exclude name="Squiz.WhiteSpace.MemberVarSpacing" />
</rule>
<!-- Add sniffs not included by PSR2R. -->
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowEmpty" />
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration" />
<rule ref="SlevomatCodingStandard.Functions.StrictCall" />
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators" />
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="declareOnFirstLine" value="true" />
<property name="spacesCountAroundEqualsSign" value="0" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable">
<properties>
<property name="ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach" value="true" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Variables.UselessVariable" />
<!-- 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="PhpCollective.ControlStructures.NoInlineAssignment">
<exclude-pattern>src/templates/*</exclude-pattern>
</rule>
<!-- Ignore unknown docstring tags. -->
<rule ref="PSR2R.Commenting.DocBlockTagTypes.Unknown">
<severity>0</severity>
</rule>
<!-- Ignore unknown docstring types. -->
<rule ref="PhpCollective.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>
<!-- PhpCollective sniffs do not support nullable typehints in docblocks.
See https://github.com/spryker/code-sniffer/issues/349. -->
<rule ref="PhpCollective.Commenting.DocBlockParamAllowDefaultValue.Default">
<severity>0</severity>
</rule>
<rule ref="PhpCollective.Commenting.DocBlockReturnNullableType.ReturnNullableMissing">
<severity>0</severity>
</rule>
<!-- Conflicts with PSR2R.Namespaces.NoInlineFullyQualifiedClassName.Signature -->
<rule ref="PhpCollective.Commenting.Attributes.ExpectedFQCN">
<severity>0</severity>
</rule>
<!-- Allow assignment in else-if where it is really needed. -->
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition">
<exclude-pattern>src/templates/Default/engine/Default/alliance_roster\.php</exclude-pattern>
</rule>
<!-- Ignore unused variable warnings for bad global variables. Fix ASAP! -->
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable">
<exclude-pattern>src/tools/npc/chess\.php</exclude-pattern>
<exclude-pattern>src/tools/irc/irc\.php</exclude-pattern>
<exclude-pattern>src/tools/npc/npc\.php</exclude-pattern>
</rule>
<!-- Ignore bug in PSR12. Will be fixed in PHP_CodeSniffer 3.7.2.
See https://github.com/squizlabs/PHP_CodeSniffer/pull/3653. -->
<rule ref="PSR12.Operators.OperatorSpacing">
<exclude-pattern>src/lib/Smr/Chess/ChessPiece\.php</exclude-pattern>
</rule>
</ruleset>