-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathphpcs.xml
79 lines (62 loc) · 3.55 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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHP_CodeSniffer" xsi:noNamespaceSchemaLocation="phpcs.xsd">
<description>Coding Standards</description>
<!-- Inspect files in the /src folder -->
<file>src</file>
<!-- Run in verbose mode and specify the precise rule that failed in output -->
<arg value="sv"/>
<arg name="colors"/>
<!-- Use PSR-12 -->
<rule ref="PSR12">
<!-- Exclude function not in camel caps format, to avoid breaking changes -->
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
<!-- Don't require spacing after header block -->
<exclude name="PSR12.Files.FileHeader.SpacingAfterBlock" />
<!-- Permit else if over elseif -->
<exclude name="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed" />
</rule>
<!-- Use Squiz -->
<rule ref="Squiz">
<!-- Don't require a package tag -->
<exclude name="Squiz.Commenting.FileComment.PackageTagOrder" />
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag" />
<exclude name="Squiz.Commenting.FileComment.MissingSubpackageTag" />
<!-- Exclude "Class found in ".php" file; use ".inc" extension instead" -->
<exclude name="Squiz.Files.FileExtension.ClassFound" />
<!-- Exclude PascalCase format for class name, to avoid breaking changes -->
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps" />
<!-- Exclude variable naming, to avoid breaking changes -->
<exclude name="Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps" />
<exclude name="Squiz.NamingConventions.ValidVariableName.NotCamelCaps" />
<exclude name="Squiz.NamingConventions.ValidFunctionName.ScopeNotCamelCaps" />
<!-- Allow implicit true and false comparisons -->
<exclude name="Squiz.Operators.ComparisonOperatorUsage.ImplicitTrue" />
<exclude name="Squiz.Operators.ComparisonOperatorUsage.NotAllowed" />
<!-- Don't require // end comments after each function, or Author / Copyright tags -->
<exclude name="Squiz.Commenting.ClosingDeclarationComment.Missing" />
<exclude name="Squiz.Commenting.FileComment.IncorrectAuthor" />
<exclude name="Squiz.Commenting.FileComment.MissingCopyrightTag" />
<exclude name="Squiz.Commenting.PostStatementComment" />
<!-- Permit inline if statements -->
<exclude name="Squiz.PHP.DisallowInlineIf.Found" />
<exclude name="Squiz.PHP.DisallowComparisonAssignment" />
<!-- Don't require various newlines and spacing before and after functions -->
<exclude name="Squiz.WhiteSpace.FunctionSpacing.AfterLast" />
<exclude name="Squiz.WhiteSpace.FunctionSpacing.After" />
<exclude name="Squiz.WhiteSpace.FunctionClosingBraceSpace.SpacingBeforeClose" />
<exclude name="Squiz.WhiteSpace.MemberVarSpacing.FirstIncorrect" />
<!-- Permit padding surrounding a concat operator -->
<exclude name="Squiz.Strings.ConcatenationSpacing.PaddingFound" />
<!-- Don't require break to align with switch -->
<exclude name="Squiz.ControlStructures.SwitchDeclaration.BreakIndent" />
<!-- Allow use of is_null() -->
<exclude name="Generic.PHP.ForbiddenFunctions" />
</rule>
<!-- Permit slightly longer line lengths -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="150"/>
<property name="absoluteLineLimit" value="0"/>
</properties>
</rule>
</ruleset>