Skip to content

Commit 34732e7

Browse files
📚 Update doc
1 parent 44c5476 commit 34732e7

File tree

2 files changed

+33
-27
lines changed

2 files changed

+33
-27
lines changed

docs/standards.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,9 @@ we do not respect this rule:
147147
```
148148
<rule ref="SymfonyCustom.Namespaces.UnusedUse"/>
149149
```
150+
151+
- Add a single space around comment tag (`@var`, `@return`, `...`)
152+
153+
```
154+
<rule ref="SymfonyCustom.WhiteSpace.DocCommentTagSpacing"/>
155+
```

docs/standards/symfony.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,57 +5,57 @@ From [symfony standard](http://symfony.com/doc/current/contributing/code/standar
55
- Add a single space after each comma delimiter
66

77
```
8-
<rule ref="SymfonyCustom.Array.ArrayDeclaration" />
8+
<rule ref="SymfonyCustom.Array.ArrayDeclaration"/>
99
```
1010

1111
- Add a single space around binary operators (`==`, `&&`, `...`)
1212
with the exception of the concatenation (`.`) operator
1313

1414
```
15-
<rule ref="Squiz.WhiteSpace.OperatorSpacing" />
15+
<rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
1616
<rule ref="Squiz.Strings.ConcatenationSpacing">
1717
<properties>
18-
<property name="ignoreNewlines" value="true" />
18+
<property name="ignoreNewlines" value="true"/>
1919
</properties>
2020
</rule>
2121
```
2222

2323
- Place unary operators (`!`, `--`, `...`) adjacent to the affected variable
2424

2525
```
26-
<rule ref="SymfonyCustom.WhiteSpace.SpaceUnaryOperatorSpacing" />
26+
<rule ref="SymfonyCustom.WhiteSpace.SpaceUnaryOperatorSpacing"/>
2727
```
2828

2929
- Always use identical comparison unless you need type juggling
3030

3131
```
32-
<rule ref="SymfonyCustom.Formatting.StrictComparison" />
32+
<rule ref="SymfonyCustom.Formatting.StrictComparison"/>
3333
```
3434

3535
- Use Yoda conditions when checking a variable against an expression
3636

3737
```
38-
<rule ref="SymfonyCustom.Formatting.YodaCondition" />
38+
<rule ref="SymfonyCustom.Formatting.YodaCondition"/>
3939
```
4040

4141
- Add a comma after each array item in a multi-line array, even after the last one
4242

4343
```
44-
<rule ref="SymfonyCustom.Array.ArrayDeclaration" />
44+
<rule ref="SymfonyCustom.Array.ArrayDeclaration"/>
4545
```
4646

4747
- Add a blank line before return statements,
4848
unless the return is alone inside a statement-group (like an `if` statement)
4949

5050
```
51-
<rule ref="SymfonyCustom.Formatting.BlankLineBeforeReturn" />
51+
<rule ref="SymfonyCustom.Formatting.BlankLineBeforeReturn"/>
5252
```
5353

5454
- Use `return null` when a function explicitly returns null values
5555
and use `return` when the function returns void values
5656

5757
```
58-
<rule ref="SymfonyCustom.Commenting.FunctionComment" />
58+
<rule ref="SymfonyCustom.Commenting.FunctionComment"/>
5959
```
6060

6161
- Use braces to indicate control structure body regardless of the number of statements it contains
@@ -73,15 +73,15 @@ Covered by `PSR2`
7373
- Declare class properties before methods
7474

7575
```
76-
<rule ref="SymfonyCustom.Classes.PropertyDeclaration" />
76+
<rule ref="SymfonyCustom.Classes.PropertyDeclaration"/>
7777
```
7878

7979
- Declare public methods first, then protected ones and finally private ones.
8080
The exceptions to this rule are the class constructor and the `setUp()` and `tearDown()` methods of PHPUnit tests,
8181
which must always be the first methods to increase readability
8282

8383
```
84-
<rule ref="SymfonyCustom.Functions.ScopeOrder" />
84+
<rule ref="SymfonyCustom.Functions.ScopeOrder"/>
8585
```
8686

8787
- 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
9191
- Use parentheses when instantiating classes regardless of the number of arguments the constructor has
9292

9393
```
94-
<rule ref="SymfonyCustom.Objects.ObjectInstantiation" />
94+
<rule ref="SymfonyCustom.Objects.ObjectInstantiation"/>
9595
```
9696

9797
- Exception and error message strings must be concatenated using `sprintf`
9898

9999
```
100-
<rule ref="SymfonyCustom.Errors.ExceptionMessage" />
100+
<rule ref="SymfonyCustom.Errors.ExceptionMessage"/>
101101
```
102102

103103
- Calls to `trigger_error` with type `E_USER_DEPRECATED` must be switched to opt-in via `@`operator
104104

105105
```
106-
<rule ref="SymfonyCustom.Errors.UserDeprecated" />
106+
<rule ref="SymfonyCustom.Errors.UserDeprecated"/>
107107
```
108108

109109
- Do not use `else`, `elseif`, `break` after `if` and `case` conditions which return or throw something
110110

111111
```
112-
<rule ref="SymfonyCustom.Formatting.ConditionalReturnOrThrowSniff" />
112+
<rule ref="SymfonyCustom.Formatting.ConditionalReturnOrThrowSniff"/>
113113
```
114114

115115
- Do not use spaces around `[` offset accessor and before `]` offset accessor
@@ -134,43 +134,43 @@ Covered by `PSR2` completed by
134134

135135
Covered by `PSR1` completed by
136136
```
137-
<rule ref="Squiz.Classes.ValidClassName" />
137+
<rule ref="Squiz.Classes.ValidClassName"/>
138138
```
139139

140140
- Prefix abstract classes with `Abstract`
141141

142142
```
143-
<rule ref="SymfonyCustom.NamingConventions.ValidClassName" />
143+
<rule ref="SymfonyCustom.NamingConventions.ValidClassName"/>
144144
```
145145

146146
- Suffix interfaces with `Interface`
147147

148148
```
149-
<rule ref="SymfonyCustom.NamingConventions.ValidClassName" />
149+
<rule ref="SymfonyCustom.NamingConventions.ValidClassName"/>
150150
```
151151

152152
- Suffix traits with `Trait`
153153

154154
```
155-
<rule ref="SymfonyCustom.NamingConventions.ValidClassName" />
155+
<rule ref="SymfonyCustom.NamingConventions.ValidClassName"/>
156156
```
157157

158158
- Suffix exceptions with `Exception`
159159

160160
```
161-
<rule ref="SymfonyCustom.NamingConventions.ValidClassName" />
161+
<rule ref="SymfonyCustom.NamingConventions.ValidClassName"/>
162162
```
163163

164164
- Use alphanumeric characters and underscores for file names
165165

166166
```
167-
<rule ref="SymfonyCustom.NamingConventions.ValidFileName" />
167+
<rule ref="SymfonyCustom.NamingConventions.ValidFileName"/>
168168
```
169169

170170
- For type-hinting in PHPDocs and casting, use `bool`, `int` and `float`
171171

172172
```
173-
<rule ref="SymfonyCustom.NamingConventions.ValidScalarTypeName" />
173+
<rule ref="SymfonyCustom.NamingConventions.ValidScalarTypeName"/>
174174
```
175175

176176
### Documentation
@@ -179,8 +179,8 @@ Covered by `PSR1` completed by
179179

180180
We added exceptions for functions `setUp`, `tearDown` and `tests` with no `@param` or `@return`
181181
```
182-
<rule ref="SymfonyCustom.Commenting.ClassComment" />
183-
<rule ref="SymfonyCustom.Commenting.FunctionComment" />
182+
<rule ref="SymfonyCustom.Commenting.ClassComment"/>
183+
<rule ref="SymfonyCustom.Commenting.FunctionComment"/>
184184
```
185185

186186
We added exceptions for param comments
@@ -194,17 +194,17 @@ We added exceptions for param comments
194194
and annotations of a different type are separated by a single blank line
195195

196196
```
197-
<rule ref="SymfonyCustom.Commenting.DocCommentGroupSameType" />
197+
<rule ref="SymfonyCustom.Commenting.DocCommentGroupSameType"/>
198198
```
199199

200200
- Omit the `@return` tag if the method does not return anything
201201

202202
```
203-
<rule ref="SymfonyCustom.Commenting.FunctionComment" />
203+
<rule ref="SymfonyCustom.Commenting.FunctionComment"/>
204204
```
205205

206206
- The `@package` and `@subpackage` annotations are not used
207207

208208
```
209-
<rule ref="SymfonyCustom.Commenting.DocCommentForbiddenTags" />
209+
<rule ref="SymfonyCustom.Commenting.DocCommentForbiddenTags"/>
210210
```

0 commit comments

Comments
 (0)