-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.phpcs.xml
145 lines (133 loc) · 5.91 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
139
140
141
142
143
144
145
<ruleset>
<arg name="tab-width" value="4"/>
<!-- don't touch files that aren't in git -->
<exclude-pattern>/.github/</exclude-pattern>
<exclude-pattern>/.vscode/</exclude-pattern>
<exclude-pattern>/gitignore/</exclude-pattern>
<exclude-pattern>/screenshots/</exclude-pattern>
<exclude-pattern>/vendor/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>
<!-- Only check .php files -->
<exclude-pattern>*\.(?!php$)</exclude-pattern>
<!-- Empty lines should contain no whitespace -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
<!-- All files must end in \n. For Linux devs -->
<rule ref="Generic.Files.EndFileNewline"/>
<rule ref="Generic.Files.LineEndings">
<properties>
<property name="eolChar" value="\n"/>
</properties>
</rule>
<!-- opening brace location and spacing -->
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
<!-- opening parenthesis location and spacing for if/elseif/else/for/foreach/etc type keywords -->
<rule ref="Squiz.ControlStructures.ControlSignature">
<!-- case 'a':, not case 'a' : -->
<properties>
<property name="requiredSpacesBeforeColon" value="0" />
</properties>
</rule>
<!-- true/false/null not TRUE/FALSE/NULL -->
<rule ref="Generic.PHP.LowerCaseConstant"/>
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen"/>
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Formatting.SpaceAfterCast"/>
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<rule ref="Generic.PHP.LowerCaseConstant"/>
<rule ref="Squiz.Classes.LowercaseClassKeywords"/>
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration"/>
<rule ref="Squiz.ControlStructures.ForLoopDeclaration"/>
<rule ref="Squiz.ControlStructures.LowercaseDeclaration"/>
<rule ref="Squiz.Scope.MemberVarScope"/>
<rule ref="Squiz.Scope.MethodScope"/>
<rule ref="PSR2.Files.EndFileNewline"/>
<rule ref="PSR2.Files.ClosingTag"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile">
<severity>0</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile">
<severity>0</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
<severity>0</severity>
</rule>
<rule ref="Generic.PHP.LowerCaseKeyword"/>
<rule ref="Generic.PHP.LowerCaseType"/>
<rule ref="PSR2.Classes.PropertyDeclaration"/>
<rule ref="Squiz.Scope.MethodScope"/>
<rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing"/>
<rule ref="PSR2.Methods.FunctionClosingBrace"/>
<rule ref="Squiz.Functions.FunctionDeclaration"/>
<rule ref="Squiz.Functions.LowercaseFunctionKeywords"/>
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
<properties>
<property name="equalsSpacing" value="1"/>
</properties>
</rule>
<rule ref="PEAR.Functions.ValidDefaultValue"/>
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
<rule ref="PSR2.Methods.FunctionCallSignature"/>
<rule ref="PSR2.Methods.FunctionCallSignature.SpaceAfterCloseBracket">
<severity>0</severity>
</rule>
<rule ref="PSR2.Methods.FunctionCallSignature.OpeningIndent">
<severity>0</severity>
</rule>
<rule ref="Squiz.ControlStructures.ControlSignature"/>
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace"/>
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration"/>
<rule ref="Squiz.ControlStructures.ForLoopDeclaration">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<rule ref="Squiz.ControlStructures.ForLoopDeclaration.SpacingAfterOpen">
<severity>0</severity>
</rule>
<rule ref="Squiz.ControlStructures.ForLoopDeclaration.SpacingBeforeClose">
<severity>0</severity>
</rule>
<rule ref="Squiz.ControlStructures.LowercaseDeclaration"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.AsNotLower">
<severity>0</severity>
</rule>
<rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
<rule ref="PSR2.ControlStructures.SwitchDeclaration"/>
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen">
<severity>0</severity>
</rule>
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose">
<severity>0</severity>
</rule>
<rule ref="Generic.WhiteSpace.IncrementDecrementSpacing"/>
<rule ref="Squiz.WhiteSpace.CastSpacing"/>
<rule ref="Squiz.Scope.MethodScope.Missing">
<severity>0</severity>
</rule>
<arg name="tab-width" value="4"/>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<!-- fix wrong indentation -->
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="4"/>
<property name="tabIndent" value="true"/>
<property name="exact" value="true"/>
<property name="ignoreIndentationTokens" type="array">
<element value="T_COMMENT"/>
<element value="T_DOC_COMMENT"/>
<!-- Long strings and heredoc/nowdoc sometimes start at the beginning of the line -->
<element value="T_CONSTANT_ENCAPSED_STRING" />
<element value="T_DOUBLE_QUOTED_STRING" />
<element value="T_START_HEREDOC" />
<element value="T_START_NOWDOC" />
<!-- PHP opening and closing tag don't have to be indented -->
<element value="T_OPEN_TAG" />
<element value="T_CLOSE_TAG" />
</property>
</properties>
</rule>
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
</ruleset>