-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathphpcs.xml.dist
91 lines (77 loc) · 4.55 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
<?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" />
<arg name="colors" />
<!-- Ignore warnings (n), show progress of the run (p), and show sniff names (s) -->
<arg value="nps"/>
<file>src</file>
<file>generator/src</file>
<file>generator/config</file>
<file>tests</file>
<!-- Ignore auto-generated code -->
<exclude-pattern>src/Builder/(Accumulator|Expression|Query|Projection|Stage)/*\.php</exclude-pattern>
<!-- Target minimum supported PHP version -->
<config name="php_version" value="80100"/>
<!-- ****************************************** -->
<!-- Import rules from doctrine/coding-standard -->
<!-- ****************************************** -->
<rule ref="Doctrine">
<exclude name="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming.SuperfluousSuffix"/>
<exclude name="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming.SuperfluousPrefix"/>
<!-- **************************************** -->
<!-- Exclude sniffs that force unwanted style -->
<!-- **************************************** -->
<exclude name="Generic.Formatting.MultipleStatementAlignment" />
<exclude name="Squiz.Commenting.FunctionComment.ThrowsNoFullStop" />
<!-- ************************************************ -->
<!-- Exclude sniffs that may cause functional changes -->
<!-- ************************************************ -->
<exclude name="Generic.PHP.ForbiddenFunctions.FoundWithAlternative" />
<exclude name="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison" />
<exclude name="SlevomatCodingStandard.ControlStructures.EarlyExit" />
<exclude name="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn" />
<exclude name="SlevomatCodingStandard.Functions.StaticClosure" />
<exclude name="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure" />
<!-- ********************* -->
<!-- Exclude broken sniffs -->
<!-- ********************* -->
<!-- Sniff currently broken when casting arrays, see https://github.com/squizlabs/PHP_CodeSniffer/issues/2937#issuecomment-615498860 -->
<exclude name="Squiz.Arrays.ArrayDeclaration.ValueNoNewline" />
<!-- Disable forbidden annotation sniff as excluding @api from the list doesn't work -->
<exclude name="SlevomatCodingStandard.Commenting.ForbiddenAnnotations.AnnotationForbidden" />
</rule>
<!-- **************************************** -->
<!-- Enable rules not enforced by Doctrine CS -->
<!-- **************************************** -->
<!-- Require arrow functions where possible -->
<rule ref="SlevomatCodingStandard.Functions.RequireArrowFunction"/>
<!-- Forbid fully qualified names even for colliding names -->
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
<properties>
<property name="allowFallbackGlobalConstants" value="false"/>
<property name="allowFallbackGlobalFunctions" value="false"/>
<property name="allowFullyQualifiedGlobalClasses" value="false"/>
<property name="allowFullyQualifiedGlobalConstants" value="false"/>
<property name="allowFullyQualifiedGlobalFunctions" value="false"/>
<property phpcs-only="true" name="allowFullyQualifiedNameForCollidingClasses" value="false"/>
<property phpcs-only="true" name="allowFullyQualifiedNameForCollidingConstants" value="false"/>
<property phpcs-only="true" name="allowFullyQualifiedNameForCollidingFunctions" value="false"/>
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<!-- ************************************************************************** -->
<!-- Require type hints for all parameters, properties, and return types in src -->
<!-- ************************************************************************** -->
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingAnyTypeHint">
<exclude-pattern>tests</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingAnyTypeHint">
<exclude-pattern>tests</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingAnyTypeHint">
<exclude-pattern>tests</exclude-pattern>
</rule>
</ruleset>