-
Notifications
You must be signed in to change notification settings - Fork 1
/
phpcs.xml
106 lines (93 loc) · 5.08 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="CSSLLC">
<description>CSSLLC Coding Standards.</description>
<file>includes</file>
<file>Plugin.php</file>
<arg name="extensions" value="php"/>
<arg name="severity" value="4"/>
<arg name="tab-width" value="4"/>
<arg value="spv"/>
<arg value="-colors"/>
<!-- Update to the PHP version your production/local docker container runs on -->
<config name="testVersion" value="8.2.8"/>
<!-- php -r 'echo PHP_VERSION_ID;' -->
<config name="php_version" value="80208%"/>
<!-- Exclude files -->
<exclude-pattern>*-config.php</exclude-pattern>
<exclude-pattern>*assets/</exclude-pattern>
<exclude-pattern>*vendor/</exclude-pattern>
<exclude-pattern>*tests/*</exclude-pattern>
<exclude-pattern>extensions\/(?!twig).*</exclude-pattern>
<exclude-pattern>*webpack/</exclude-pattern>
<!-- Rules -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>includes/types/Image_Tag.php</exclude-pattern>
</rule>
<!-- PSR2 -->
<rule ref="PSR2">
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
<exclude name="Generic.Files.LineLength.TooLong"/>
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols"/>
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
<exclude name="PSR2.Methods.FunctionCallSignature.SpaceAfterOpenBracket"/>
<exclude name="PSR2.Methods.FunctionCallSignature.SpaceBeforeCloseBracket"/>
<exclude name="PSR2.Classes.ClassDeclaration.OpenBraceNewLine"/>
<exclude name="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody"/>
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace"/>
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpaceBeforeCloseBrace"/>
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/>
<exclude name="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen"/>
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/>
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterOpen"/>
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingBeforeClose"/>
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/>
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen"/>
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose"/>
<exclude name="Generic.WhiteSpace.ScopeIndent.IncorrectExact"/>
<exclude name="Generic.Files.EndFileNewline.NotFound"/>
<exclude name="PSR2.Files.EndFileNewline.NoneFound"/>
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect"/>
<exclude name="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed"/>
<exclude name="PSR12.Files.DeclareStatement.SpaceFoundBeforeDirective"/>
<exclude name="PSR12.Files.DeclareStatement.SpaceFoundAfterDirectiveValue"/>
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
</rule>
<!--
Prevent errors caused by WordPress Coding Standards not supporting PHP 8.0+.
See https://github.com/WordPress/WordPress-Coding-Standards/issues/2035
and https://gist.github.com/shreyasikhar/f4495ac952586096eb81d505e9e914a4.
-->
<ini name="error_reporting" value="E_ALL & ~E_DEPRECATED" />
<!-- PSR12 -->
<rule ref="PSR12.Files.DeclareStatement"/>
<!-- Function spacing -->
<rule ref="PEAR.Functions.FunctionCallSignature">
<properties>
<property name="requiredSpacesAfterOpen" value="1"/>
<property name="requiredSpacesBeforeClose" value="1"/>
</properties>
<severity>0</severity>
</rule>
<!-- Now that we've excluded all message codes from FunctionCallSignature,
re-enable the two codes that we actually want. This will change the severity
of these codes from 0 (set by the above rule) to the default value (5). -->
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket" />
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket" />
<!-- WordPress -->
<rule ref="WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned"/>
<rule ref="WordPress.WhiteSpace.OperatorSpacing"/>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceAfterOpenParenthesis"/>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBeforeCloseParenthesis"/>
<rule ref="WordPress.Arrays.ArrayKeySpacingRestrictions"/>
<rule ref="WordPressVIPMinimum">
<severity>3</severity>
<exclude name="WordPressVIPMinimum.Constants.ConstantString.NotCheckingConstantName"/>
</rule>
<!-- Generic -->
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
<rule ref="Generic.Classes.OpeningBraceSameLine"/>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="Generic.Formatting.MultipleStatementAlignment"/>
<rule ref="Generic.Files.EndFileNewline"/>
<rule ref="Generic.VersionControl.GitMergeConflict"/>
</ruleset>