-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs-ruleset.xml
More file actions
91 lines (80 loc) · 4.43 KB
/
phpcs-ruleset.xml
File metadata and controls
91 lines (80 loc) · 4.43 KB
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 name="ApiBundle">
<arg name="tab-width" value="4"/>
<!-- Include the whole PSR-2 standard -->
<rule ref="PSR1"/>
<rule ref="PSR2"/>
<rule ref="vendor/slevomat/coding-standard/SlevomatCodingStandard/ruleset.xml">
<!-- 4 spaces should be used as per PSR1 -->
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent"/>
<!-- Enforcing fully qualified namespaces makes no sense -->
<exclude name="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces.NonFullyQualified"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation.NonFullyQualifiedClassName"/>
<!-- No comment should be considered useless -->
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.UselessDocComment"/>
<!-- Contradicts PSR-2 -->
<exclude name="SlevomatCodingStandard.Types.EmptyLinesAroundTypeBraces"/>
<!-- Yoda comparisons are confusing -->
<exclude name="SlevomatCodingStandard.ControlStructures.RequireYodaComparison" />
<!-- Bad practice .. -->
<exclude name="SlevomatCodingStandard.ControlStructures.NewWithoutParentheses.UselessParentheses" />
<!-- Should be single line -->
<exclude name="SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment" />
<exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming.SuperfluousSuffix" />
<!-- Ternaries should be allowed and are useful -->
<exclude name="SlevomatCodingStandard.ControlStructures.DisallowShortTernaryOperator" />
<!-- Sometimes you need to extend a function and not use one of its params -->
<exclude name="SlevomatCodingStandard.Functions.UnusedParameter" />
<!-- For repositories using traits, sometimes there is nothing to put after the traits. -->
<exclude name="SlevomatCodingStandard.Classes.TraitUseSpacing" />
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameAfterKeyword">
<properties>
<property name="keywordsToCheck" type="array" value="T_EXTENDS,T_IMPLEMENTS"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
<properties>
<property name="fullyQualifiedKeywords" type="array" value="T_EXTENDS,T_IMPLEMENTS" />
<property name="allowFullyQualifiedExceptions" type="boolean" value="true" />
<property name="allowFullyQualifiedGlobalClasses" type="boolean" value="true" />
<property name="allowFullyQualifiedGlobalFunctions" type="boolean" value="true" />
<property name="allowFullyQualifiedGlobalConstants" type="boolean" value="true" />
</properties>
</rule>
<rule ref="Squiz.Commenting.FunctionComment">
<exclude name="Squiz.Commenting.FunctionComment.InvalidReturn"/>
<exclude name="Squiz.Commenting.FunctionComment.MissingReturn"/>
<exclude name="Squiz.Commenting.FunctionComment.IncorrectTypeHint"/>
<exclude name="Squiz.Commenting.FunctionComment.IncorrectParamVarName"/>
</rule>
<rule ref="Squiz.NamingConventions">
<exclude name="Squiz.NamingConventions.ValidVariableName.PublicHasUnderscore" />
<exclude name="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore" />
<exclude name="Squiz.NamingConventions.ValidFunctionName.PrivateNoUnderscore" />
</rule>
<rule ref="Squiz.Strings.ConcatenationSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
<property name="spacing" value="1"/>
</properties>
</rule>
<rule ref="Squiz.Strings.DoubleQuoteUsage"/>
<rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar">
<message>Variable "%s" not allowed in double quoted string; use sprintf() instead</message>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" type="boolean" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
<properties>
<property name="linesCountBetweenDifferentAnnotationsTypes" type="integer" value="0" />
</properties>
</rule>
<rule ref="Generic.Arrays.DisallowLongArraySyntax.Found">
<type>warning</type>
</rule>
<exclude-pattern>*/_*</exclude-pattern>
</ruleset>