-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathphpcs.xml
106 lines (100 loc) · 4.99 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
<?xml version="1.0"?>
<ruleset name="Tweakwise">
<description>Tweakwise coding standard ruleset for PHP.</description>
<config name="installed_paths" value="../../slevomat/coding-standard,../../magento-ecg/coding-standard" />
<arg name="extensions" value="php,phtml" />
<arg name="parallel" value="60" />
<rule ref="PSR12" />
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes" />
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="1" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit" />
<!--
Some functions have a $strict parameter.
This sniff reports calls to these functions without the parameter or with $strict = false.
-->
<rule ref="SlevomatCodingStandard.Functions.StrictCall" />
<!--
Disallows using loose == and != comparison operators. Use === and !== instead, they are much more secure and predictable.
-->
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators" />
<!--
Reference usage always leads to difficult to understand code.
There is always a better solution to implement then references.
-->
<rule ref="SlevomatCodingStandard.PHP.DisallowReference" />
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias" />
<rule ref="SlevomatCodingStandard.PHP.UselessParentheses" />
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon" />
<rule ref="SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable" />
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable" />
<rule ref="SlevomatCodingStandard.Variables.UselessVariable" />
<!-- In strict code it makes sense to forbid this weakly typed form of ternary altogether. -->
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowShortTernaryOperator" />
<!-- Since we disable the use of if condition assignments there is no positive use of YodaComparisons -->
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison" />
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility" />
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.IncorrectStrictTypesFormat" />
</rule>
<!--
Assignments in conditions encourage nesting and is hard to read.
This also fixes accidental assignments instead of comparisons.
-->
<rule ref="Generic.CodeAnalysis.AssignmentInCondition">
<type>error</type>
<exclude name="Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition" />
</rule>
<rule ref="Generic.Classes.DuplicateClassName" />
<rule ref="Generic.CodeAnalysis.EmptyStatement" />
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" />
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall" />
<rule ref="Generic.CodeAnalysis.JumbledIncrementer" />
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement" />
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier" />
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod" />
<rule ref="Generic.Commenting.Fixme" />
<rule ref="Generic.Files.ByteOrderMark" />
<rule ref="Generic.Files.OneClassPerFile" />
<rule ref="Generic.Files.OneInterfacePerFile" />
<rule ref="Generic.Functions.CallTimePassByReference" />
<rule ref="Generic.Metrics.CyclomaticComplexity" />
<rule ref="Generic.Metrics.NestingLevel" />
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag">
<exclude-pattern>*.phtml</exclude-pattern>
</rule>
<rule ref="Generic.PHP.DeprecatedFunctions" />
<rule ref="Generic.PHP.NoSilencedErrors" />
<rule ref="Generic.PHP.Syntax" />
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="120" />
<property name="absoluteLineLimit" value="120" />
</properties>
</rule>
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag">
<exclude-pattern>*.phtml</exclude-pattern>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement">
<!-- EmptyCatch is handled by Squiz.Commenting.EmptyCatchComment -->
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch" />
</rule>
<rule ref="Squiz.Functions.GlobalFunction" />
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing" />
<rule ref="Squiz.PHP.Eval" />
<rule ref="Squiz.PHP.GlobalKeyword" />
<rule ref="Squiz.PHP.NonExecutableCode" />
<rule ref="Squiz.Scope.MethodScope" />
<rule ref="Squiz.Scope.MemberVarScope" />
<rule ref="Squiz.Strings.DoubleQuoteUsage" />
<rule ref="Squiz.Operators.IncrementDecrementUsage">
<exclude name="Squiz.Operators.IncrementDecrementUsage.Found" />
</rule>
<rule ref="Squiz.Commenting.EmptyCatchComment" />
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
</ruleset>