-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathphpcs.xml
More file actions
97 lines (87 loc) · 4.56 KB
/
Copy pathphpcs.xml
File metadata and controls
97 lines (87 loc) · 4.56 KB
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
<?xml version="1.0"?>
<ruleset name="Winter CMS Plugins">
<description>The coding standard for Winter CMS Plugins.</description>
<rule ref="PSR2">
<!--
Exceptions to the PSR-2 guidelines as per our Developer Guide:
https://wintercms.com/help/guidelines/developer#psr-exceptions
-->
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace" />
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace" />
<!-- We're not enforcing a line length limit -->
<exclude name="Generic.Files.LineLength" />
</rule>
<rule ref="Squiz.ControlStructures.ControlSignature">
<!-- We use 0 spaces before the colon for short (alternative) tags -->
<properties>
<property name="requiredSpacesBeforeColon" value="0" />
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen">
<!--
Ignore correct spacing for control structures in partial templates - spacing may be useful
for templates to easily deduce HTML code that is conditional
-->
<exclude-pattern>*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/partials/*\.php</exclude-pattern>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<!-- Migration files and tests do not need a namespace defined -->
<exclude-pattern>*/updates/*\.php</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<!--
Test bootstraps declare a conditional base test case class for cross-version
compatibility (e.g. System\Tests\Bootstrap\PluginTestCase vs PluginTestCase)
-->
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="PSR2.Files.ClosingTag.NotAllowed">
<!--
Partials may finish on a closing tag, especially when using the short echo "<?= ?>" tag. We'll allow this.
-->
<exclude-pattern>*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/partials/*\.php</exclude-pattern>
</rule>
<rule ref="PSR2.ControlStructures.SwitchDeclaration.BodyOnNextLineCASE">
<!--
Partials may have HTML within switch/case statements, which look neater when inline. PHPCS also has difficulty
interpreting a short echo tag on a new line within a switch/case statement.
-->
<exclude-pattern>*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/partials/*\.php</exclude-pattern>
</rule>
<rule ref="PSR2.ControlStructures.SwitchDeclaration.BreakNotNewLine">
<exclude-pattern>*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/partials/*\.php</exclude-pattern>
</rule>
<arg name="extensions" value="php" />
<arg name="colors" />
<arg value="nq" />
<file>.</file>
<exclude-pattern>*/assets/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
</ruleset>