This repository has been archived by the owner on Oct 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathphpcs.xml
74 lines (62 loc) · 2.94 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
<?xml version="1.0"?>
<ruleset name="ie2">
<description>ie2 coding standard</description>
<file>./app</file>
<arg value="sp"/>
<!-- Use PSR2 as a base -->
<rule ref="PSR2">
<!-- Allow opening and closing braces for functions and classes to be on the same line -->
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine" />
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine" />
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace" />
<!-- Disable newline after opening brace -->
<exclude name="Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace" />
<!-- Ignore some warnings due to CakePHP -->
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols" />
</rule>
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie" />
<!-- Enforce short array syntax -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax.Found">
<type>warning</type>
</rule>
<!-- Verify that operators have valid spacing surrounding them -->
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<!-- Code Analysis -->
<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" />
<!-- Documenting -->
<rule ref="Squiz.Commenting.DocCommentAlignment" />
<rule ref="Generic.Commenting.Todo" />
<!-- General good things to have -->
<rule ref="Generic.Formatting.NoSpaceAfterCast" />
<rule ref="Squiz.Operators.ValidLogicalOperators" />
<rule ref="Squiz.PHP.Eval" />
<rule ref="Squiz.PHP.NonExecutableCode" />
<rule ref="Generic.PHP.NoSilencedErrors" />
<rule ref="Generic.PHP.DeprecatedFunctions" />
<rule ref="Squiz.WhiteSpace.MemberVarSpacing"/>
<rule ref="PEAR.ControlStructures.MultiLineCondition"/>
<rule ref="PEAR.Formatting.MultiLineAssignment"/>
<!-- Code complexity and nesting -->
<rule ref="Generic.Metrics.CyclomaticComplexity"/>
<rule ref="Generic.Metrics.NestingLevel"/>
<!-- Ignore valid class name due to CakePHP -->
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
<exclude-pattern>./app/Config/database.php</exclude-pattern>
</rule>
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern>./app/Console/Command/EngineShell.php</exclude-pattern>
</rule>
<!-- Ignore underscore method names, thanks Cake... -->
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
<exclude-pattern>./app/Controller/AppController.php</exclude-pattern>
</rule>
</ruleset>