forked from wintercms/winter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
138 lines (127 loc) · 7.81 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?xml version="1.0"?>
<ruleset name="Winter CMS">
<description>The coding standard for Winter CMS.</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 structure in partial templates - spacing may be useful for templates to
easily deduce HTML code that is conditional
-->
<exclude-pattern>*/modules/*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/partials/*\.php</exclude-pattern>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<!-- Migration files and tests do not need a namespace defined -->
<exclude-pattern>*/database/migrations/*\.php</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<!--
Test fixtures and cases can have multiple classes defined, only if they are directly related to the test, or are
extended classes
-->
<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>*/modules/*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/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>*/modules/*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/partials/*\.php</exclude-pattern>
</rule>
<rule ref="PSR2.ControlStructures.SwitchDeclaration.BreakNotNewLine">
<!--
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>*/modules/*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/modules/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/behaviors/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/components/*/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/controllers/*/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/formwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/reportwidgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/widgets/*/partials/*\.php</exclude-pattern>
<exclude-pattern>*/plugins/*/*/partials/*\.php</exclude-pattern>
</rule>
<arg name="extensions" value="php" />
<arg name="colors" />
<file>bootstrap/</file>
<file>config/</file>
<file>modules/</file>
<file>plugins/winter/demo/</file>
<file>tests/</file>
<!-- Ignore vendor files -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<!-- Ignore this view file as fixing the issues in here will break the template -->
<exclude-pattern>modules/system/views/exception.php</exclude-pattern>
<!-- Ignore this view file as PHPCS wants line 8 to have 44 spaces instead of 12, clearly insane -->
<exclude-pattern>modules/backend/widgets/mediamanager/partials/_item-icon.php</exclude-pattern>
<!-- Ignore this test case completely as it's testing a parse error -->
<exclude-pattern>tests/fixtures/plugins/testvendor/goto/Plugin.php</exclude-pattern>
</ruleset>