-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
88 lines (71 loc) · 3.09 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
<?xml version="1.0"?>
<ruleset>
<!-- Installs https://github.com/slevomat/coding-standard -->
<config name="installed_paths" value="../../slevomat/coding-standard"/>
<rule ref="PSR12" />
<file>config</file>
<file>src</file>
<file>tests</file>
<!-- Ignore Class Declaration rule for database -->
<rule ref="PSR1.Classes.ClassDeclaration">
<exclude-pattern>*/database/*</exclude-pattern>
</rule>
<!-- Ignore anything under the vendor folder -->
<exclude-pattern>*/vendor</exclude-pattern>
<!-- Ignore CamelCase methods rule for tests -->
<rule ref="PSR1.Methods.CamelCapsMethodName">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Ignore inline controler structures not allowed -->
<rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- Ignore blank line found at start of control structure -->
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- Ensure no more than 1 blank lines in a row -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>
<!-- Ensure no more than 1 blank lines in a row -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
<severity>5</severity>
</rule>
<!-- Ensure 1 blank line before and after functions, except at the top and bottom -->
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
<properties>
<property name="spacing" value="1" />
<property name="spacingBeforeFirst" value="0" />
<property name="spacingAfterLast" value="0" />
</properties>
</rule>
<!-- Ensure there are no spaces surrounding an object operator -->
<rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true" />
</properties>
</rule>
<!-- Ensures there is one space before and after an operator -->
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true" />
</properties>
</rule>
<!-- Enforce indent of keys in a multi-line array declaration -->
<rule ref="Generic.Arrays.ArrayIndent" />
<!-- Checks whether uses at the top of a file are alphabetically sorted -->
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
<!-- Enforces trailing commas in multi-line arrays and requires short array syntax -->
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/>
<!-- Looks for unused imports from other namespaces -->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true" />
</properties>
</rule>
<!-- Double quotes not allowed unless used with variables -->
<rule ref="Squiz.Strings.DoubleQuoteUsage.NotRequired" />
</ruleset>