@@ -5,57 +5,57 @@ From [symfony standard](http://symfony.com/doc/current/contributing/code/standar
5
5
- Add a single space after each comma delimiter
6
6
7
7
```
8
- <rule ref="SymfonyCustom.Array.ArrayDeclaration" />
8
+ <rule ref="SymfonyCustom.Array.ArrayDeclaration"/>
9
9
```
10
10
11
11
- Add a single space around binary operators (` == ` , ` && ` , ` ... ` )
12
12
with the exception of the concatenation (` . ` ) operator
13
13
14
14
```
15
- <rule ref="Squiz.WhiteSpace.OperatorSpacing" />
15
+ <rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
16
16
<rule ref="Squiz.Strings.ConcatenationSpacing">
17
17
<properties>
18
- <property name="ignoreNewlines" value="true" />
18
+ <property name="ignoreNewlines" value="true"/>
19
19
</properties>
20
20
</rule>
21
21
```
22
22
23
23
- Place unary operators (` ! ` , ` -- ` , ` ... ` ) adjacent to the affected variable
24
24
25
25
```
26
- <rule ref="SymfonyCustom.WhiteSpace.SpaceUnaryOperatorSpacing" />
26
+ <rule ref="SymfonyCustom.WhiteSpace.SpaceUnaryOperatorSpacing"/>
27
27
```
28
28
29
29
- Always use identical comparison unless you need type juggling
30
30
31
31
```
32
- <rule ref="SymfonyCustom.Formatting.StrictComparison" />
32
+ <rule ref="SymfonyCustom.Formatting.StrictComparison"/>
33
33
```
34
34
35
35
- Use Yoda conditions when checking a variable against an expression
36
36
37
37
```
38
- <rule ref="SymfonyCustom.Formatting.YodaCondition" />
38
+ <rule ref="SymfonyCustom.Formatting.YodaCondition"/>
39
39
```
40
40
41
41
- Add a comma after each array item in a multi-line array, even after the last one
42
42
43
43
```
44
- <rule ref="SymfonyCustom.Array.ArrayDeclaration" />
44
+ <rule ref="SymfonyCustom.Array.ArrayDeclaration"/>
45
45
```
46
46
47
47
- Add a blank line before return statements,
48
48
unless the return is alone inside a statement-group (like an ` if ` statement)
49
49
50
50
```
51
- <rule ref="SymfonyCustom.Formatting.BlankLineBeforeReturn" />
51
+ <rule ref="SymfonyCustom.Formatting.BlankLineBeforeReturn"/>
52
52
```
53
53
54
54
- Use ` return null ` when a function explicitly returns null values
55
55
and use ` return ` when the function returns void values
56
56
57
57
```
58
- <rule ref="SymfonyCustom.Commenting.FunctionComment" />
58
+ <rule ref="SymfonyCustom.Commenting.FunctionComment"/>
59
59
```
60
60
61
61
- Use braces to indicate control structure body regardless of the number of statements it contains
@@ -73,15 +73,15 @@ Covered by `PSR2`
73
73
- Declare class properties before methods
74
74
75
75
```
76
- <rule ref="SymfonyCustom.Classes.PropertyDeclaration" />
76
+ <rule ref="SymfonyCustom.Classes.PropertyDeclaration"/>
77
77
```
78
78
79
79
- Declare public methods first, then protected ones and finally private ones.
80
80
The exceptions to this rule are the class constructor and the ` setUp() ` and ` tearDown() ` methods of PHPUnit tests,
81
81
which must always be the first methods to increase readability
82
82
83
83
```
84
- <rule ref="SymfonyCustom.Functions.ScopeOrder" />
84
+ <rule ref="SymfonyCustom.Functions.ScopeOrder"/>
85
85
```
86
86
87
87
- Declare all the arguments on the same line as the method/function name, no matter how many arguments there are
@@ -91,25 +91,25 @@ Not checked because of the limit of 120 characters per line
91
91
- Use parentheses when instantiating classes regardless of the number of arguments the constructor has
92
92
93
93
```
94
- <rule ref="SymfonyCustom.Objects.ObjectInstantiation" />
94
+ <rule ref="SymfonyCustom.Objects.ObjectInstantiation"/>
95
95
```
96
96
97
97
- Exception and error message strings must be concatenated using ` sprintf `
98
98
99
99
```
100
- <rule ref="SymfonyCustom.Errors.ExceptionMessage" />
100
+ <rule ref="SymfonyCustom.Errors.ExceptionMessage"/>
101
101
```
102
102
103
103
- Calls to ` trigger_error ` with type ` E_USER_DEPRECATED ` must be switched to opt-in via ` @ ` operator
104
104
105
105
```
106
- <rule ref="SymfonyCustom.Errors.UserDeprecated" />
106
+ <rule ref="SymfonyCustom.Errors.UserDeprecated"/>
107
107
```
108
108
109
109
- Do not use ` else ` , ` elseif ` , ` break ` after ` if ` and ` case ` conditions which return or throw something
110
110
111
111
```
112
- <rule ref="SymfonyCustom.Formatting.ConditionalReturnOrThrowSniff" />
112
+ <rule ref="SymfonyCustom.Formatting.ConditionalReturnOrThrowSniff"/>
113
113
```
114
114
115
115
- Do not use spaces around ` [ ` offset accessor and before ` ] ` offset accessor
@@ -134,43 +134,43 @@ Covered by `PSR2` completed by
134
134
135
135
Covered by ` PSR1 ` completed by
136
136
```
137
- <rule ref="Squiz.Classes.ValidClassName" />
137
+ <rule ref="Squiz.Classes.ValidClassName"/>
138
138
```
139
139
140
140
- Prefix abstract classes with ` Abstract `
141
141
142
142
```
143
- <rule ref="SymfonyCustom.NamingConventions.ValidClassName" />
143
+ <rule ref="SymfonyCustom.NamingConventions.ValidClassName"/>
144
144
```
145
145
146
146
- Suffix interfaces with ` Interface `
147
147
148
148
```
149
- <rule ref="SymfonyCustom.NamingConventions.ValidClassName" />
149
+ <rule ref="SymfonyCustom.NamingConventions.ValidClassName"/>
150
150
```
151
151
152
152
- Suffix traits with ` Trait `
153
153
154
154
```
155
- <rule ref="SymfonyCustom.NamingConventions.ValidClassName" />
155
+ <rule ref="SymfonyCustom.NamingConventions.ValidClassName"/>
156
156
```
157
157
158
158
- Suffix exceptions with ` Exception `
159
159
160
160
```
161
- <rule ref="SymfonyCustom.NamingConventions.ValidClassName" />
161
+ <rule ref="SymfonyCustom.NamingConventions.ValidClassName"/>
162
162
```
163
163
164
164
- Use alphanumeric characters and underscores for file names
165
165
166
166
```
167
- <rule ref="SymfonyCustom.NamingConventions.ValidFileName" />
167
+ <rule ref="SymfonyCustom.NamingConventions.ValidFileName"/>
168
168
```
169
169
170
170
- For type-hinting in PHPDocs and casting, use ` bool ` , ` int ` and ` float `
171
171
172
172
```
173
- <rule ref="SymfonyCustom.NamingConventions.ValidScalarTypeName" />
173
+ <rule ref="SymfonyCustom.NamingConventions.ValidScalarTypeName"/>
174
174
```
175
175
176
176
### Documentation
@@ -179,8 +179,8 @@ Covered by `PSR1` completed by
179
179
180
180
We added exceptions for functions ` setUp ` , ` tearDown ` and ` tests ` with no ` @param ` or ` @return `
181
181
```
182
- <rule ref="SymfonyCustom.Commenting.ClassComment" />
183
- <rule ref="SymfonyCustom.Commenting.FunctionComment" />
182
+ <rule ref="SymfonyCustom.Commenting.ClassComment"/>
183
+ <rule ref="SymfonyCustom.Commenting.FunctionComment"/>
184
184
```
185
185
186
186
We added exceptions for param comments
@@ -194,17 +194,17 @@ We added exceptions for param comments
194
194
and annotations of a different type are separated by a single blank line
195
195
196
196
```
197
- <rule ref="SymfonyCustom.Commenting.DocCommentGroupSameType" />
197
+ <rule ref="SymfonyCustom.Commenting.DocCommentGroupSameType"/>
198
198
```
199
199
200
200
- Omit the ` @return ` tag if the method does not return anything
201
201
202
202
```
203
- <rule ref="SymfonyCustom.Commenting.FunctionComment" />
203
+ <rule ref="SymfonyCustom.Commenting.FunctionComment"/>
204
204
```
205
205
206
206
- The ` @package ` and ` @subpackage ` annotations are not used
207
207
208
208
```
209
- <rule ref="SymfonyCustom.Commenting.DocCommentForbiddenTags" />
209
+ <rule ref="SymfonyCustom.Commenting.DocCommentForbiddenTags"/>
210
210
```
0 commit comments