-
-
Notifications
You must be signed in to change notification settings - Fork 462
/
phpcs.xml
73 lines (64 loc) · 3.39 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
<?xml version="1.0"?>
<ruleset name="AJF Coding Standards">
<description>A custom ruleset to take in account both WordPress and personal standards.</description>
<!-- Show progress and sniff codes in all reports -->
<arg value="ps"/>
<arg value="sp"/>
<arg name="colors"/>
<!-- Only check PHP files. -->
<arg name="extensions" value="php"/>
<file>.</file>
<!-- Exclude these -->
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<exclude-pattern>/tests/*</exclude-pattern>
<exclude-pattern>*.js</exclude-pattern>
<rule ref="WordPress">
<exclude name="WordPress.Files.FileName.InvalidClassFileName"/>
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/>
<exclude name="WordPress.NamingConventions.ValidVariableName"/>
<exclude name="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents"/>
<exclude name="WordPress.WP.AlternativeFunctions.parse_url_parse_url"/>
<exclude name="WordPress.WP.AlternativeFunctions.json_encode_json_encode"/>
<exclude name="WordPress.WP.I18n.NonSingularStringLiteralText"/>
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose"/>
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/>
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/>
<exclude name="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen"/>
<exclude name="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose"/>
<exclude name="Squiz.ControlStructures.InlineIfDeclaration.NotSingleLine"/>
<exclude name="Squiz.ControlStructures.ElseIfDeclaration.NotAllowed"/>
<exclude name="Squiz.ControlStructures.SwitchDeclaration.MissingDefault"/>
<exclude name="Squiz.ControlStructures.SwitchDeclaration.EmptyDefault"/>
<exclude name="Squiz.ControlStructures.SwitchDeclaration.EmptyCase"/>
</rule>
<!-- Enforce space before closing parenthesis -->
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose">
<severity>5</severity>
</rule>
<rule ref="Universal.Classes">
<exclude name="Universal.Classes.RequireFinalClass.NonFinalClassFound"/>
<exclude name="Universal.Classes.DisallowFinalClass.FinalClassFound"/>
</rule>
<rule ref="Universal.Namespaces">
<exclude name="Universal.Namespaces.EnforceCurlyBraceSyntax.Forbidden"/>
</rule>
<rule ref="Universal.FunctionDeclarations">
<exclude name="Universal.FunctionDeclarations.NoLongClosures.ExceedsRecommended"/>
<exclude name="Universal.FunctionDeclarations.NoLongClosures.ExceedsMaximum"/>
</rule>
<rule ref="Universal.Operators">
<exclude name="Universal.Operators.DisallowShortTernary.Found"/>
</rule>
<rule ref="Universal.CodeAnalysis">
<exclude name="Universal.CodeAnalysis.ConstructorDestructorReturn.ReturnValueFound"/>
<exclude name="Universal.CodeAnalysis.ConstructorDestructorReturn.ReturnValueFound"/>
</rule>
<!-- Use short arrays -->
<rule ref="Universal.Arrays">
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found"/>
</rule>
<rule ref="Generic.Arrays">
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found"/>
</rule>
</ruleset>