-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpcs.xml
163 lines (139 loc) · 5.17 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?xml version="1.0"?>
<ruleset name="BFITech">
<description>BFITech PHP Coding Convention.</description>
<!-- source -->
<file>src</file>
<!-- configuration -->
<!-- * config set -->
<!-- + only process PHP -->
<arg name="extensions" value="php"/>
<!-- + max report width -->
<arg name="report-width" value="72"/>
<!-- + tab width -->
<arg name="tab-width" value="4"/>
<!-- + do not cache -->
<arg name="no-cache"/>
<!-- + show warnings -->
<arg value="w"/>
<!-- * ini set -->
<ini name="memory_limit" value="32M"/>
<!-- * runtime set -->
<!-- + retcode=0 on warnings -->
<config name="ignore_warnings_on_exit" value="1"/>
<!-- exceptions -->
<rule>
<!-- no camel case for method names -->
<exclude ref="Generic.NamingConventions.CamelCapsFunctionName"/>
<!-- allow multiple assignments, useful before extract() -->
<exclude ref="Generic.Formatting.MultipleStatementAlignment"/>
</rule>
<!-- tabs for indentation -->
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="4"/>
<property name="tabIndent" value="true"/>
<property name="ignoreIndentationTokens" type="array"
value="T_HEREDOC,T_NOWDOC,T_INLINE_HTML"/>
</properties>
</rule>
<!-- always start file with <?php -->
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<rule ref="Generic.PHP.DisallowAlternativePHPTags"/>
<!-- never end file with ?> -->
<rule ref="PSR2.Files.ClosingTag"/>
<!-- constants are all-caps -->
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<!-- no BOM -->
<rule ref="Generic.Files.ByteOrderMark"/>
<!-- no `else if`, always `elseif` -->
<rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
<!-- must use K&R braces, including on classes -->
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie" />
<rule ref="Generic.Classes.OpeningBraceSameLine"/>
<!-- line width -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="72"/>
<!-- disable absolute to always invoke warning as in some
cases, exceeding the limit is unavoidable -->
<property name="absoluteLineLimit" value="0"/>
</properties>
</rule>
<!-- default value must be at the end, python-style -->
<rule ref="PEAR.Functions.ValidDefaultValue.NotAtEnd"/>
<!-- do not accept \r\n or \r for EOL -->
<rule ref="Generic.Files.LineEndings">
<properties>
<property name="eolChar" value="\n"/>
</properties>
</rule>
<!-- end file with EOL; won't be visible on most editors
as it's treated as terminator instead of separator -->
<rule ref="PSR2.Files.EndFileNewline"/>
<!-- language keywords must be in lowercase -->
<rule ref="Generic.PHP.LowerCaseKeyword"/>
<rule ref="Generic.PHP.LowerCaseConstant"/>
<!-- no padding to make '=' appears inlined, PEP8-style -->
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<properties>
<property name="maxPadding" value="1"/>
<property name="ignoreMultiLine" value="true"/>
<property name="error" value="true"/>
</properties>
</rule>
<!-- always 1 space after function -->
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
<properties>
<property name="spacing" value="1" />
</properties>
</rule>
<!-- always 1 space around logical operators -->
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
<!-- always 1 space before ';' -->
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
<!-- no space after cast -->
<rule ref="Generic.Formatting.NoSpaceAfterCast"/>
<!-- no trailing white space -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
<!-- no spaces around '=' at function declarations -->
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
<properties>
<property name="equalsSpacing" value="0" />
</properties>
</rule>
<!-- cyclo, no NPath sniff so far -->
<rule ref="Generic.Metrics.CyclomaticComplexity"/>
<!-- nesting -->
<rule ref="Generic.Metrics.NestingLevel">
<properties>
<property name="nestingLevel" value="4"/>
<property name="absoluteNestingLevel" value="5"/>
</properties>
</rule>
<!-- phpmd-like -->
<rule ref="Squiz.Classes.DuplicateProperty.Found"/>
<rule ref="Squiz.Classes.SelfMemberReference.IncorrectCase"/>
<rule ref="Squiz.Classes.SelfMemberReference.NotUsed"/>
<rule ref="Squiz.Classes.SelfMemberReference.SpaceBefore"/>
<rule ref="Squiz.Classes.SelfMemberReference.SpaceAfter"/>
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration"/>
<rule ref="Squiz.ControlStructures.ForLoopDeclaration"/>
<rule ref="Squiz.ControlStructures.LowercaseDeclaration"/>
<rule ref="Squiz.Functions.FunctionDuplicateArgument.Found"/>
<rule ref="Squiz.PHP.CommentedOutCode.Found"/>
<rule ref="Squiz.PHP.NonExecutableCode.Unreachable"/>
<rule ref="Squiz.PHP.NonExecutableCode.ReturnNotRequired"/>
<rule ref="Squiz.Scope.MemberVarScope.Missing"/>
<rule ref="Squiz.Scope.StaticThisUsage.Found"/>
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace"/>
<!-- warn todos, don't err out -->
<rule ref="Generic.Commenting.Todo.CommentFound">
<message>TODO: "%s"</message>
<type>warning</type>
</rule>
<rule ref="Generic.Commenting.Fixme.TaskFound">
<message>FIXME: "%s"</message>
<type>warning</type>
</rule>
</ruleset>