Skip to content

Commit fd07be7

Browse files
author
Vincent Langlet
committed
📚 Improve doc
1 parent b7ead15 commit fd07be7

File tree

1 file changed

+67
-12
lines changed

1 file changed

+67
-12
lines changed

docs/coding-standard.md

Lines changed: 67 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
# Coding Standard Rules
2-
## General
3-
We added
4-
- `PSR1` and `PSR2` rules
2+
## From PSR2
53

6-
- All `Zend` rules except:
4+
@TODO
5+
6+
## From Zend
7+
8+
@TODO
79

810
```
9-
<rule ref="Zend.NamingConventions.ValidVariableName.PrivateNoUnderscore">
10-
<severity>0</severity>
11+
<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman">
12+
<exclude name="Generic.Functions.OpeningFunctionBraceBsdAllman.BraceOnSameLine"/>
1113
</rule>
12-
13-
<rule ref="Zend.NamingConventions.ValidVariableName.ContainsNumbers">
14-
<severity>0</severity>
14+
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
15+
<rule ref="PEAR.Classes.ClassDeclaration"/>
16+
<rule ref="Squiz.Functions.GlobalFunction"/>
17+
<rule ref="Squiz.NamingConventions.ValidVariableName">
18+
<exclude name="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore"/>
19+
<exclude name="Squiz.NamingConventions.ValidVariableName.ContainsNumbers"/>
1520
</rule>
1621
```
1722

@@ -73,9 +78,7 @@ Covered by `PSR2`
7378

7479
- Define one class per file
7580

76-
```
77-
<rule ref="Symfony3Custom.Classes.MultipleClassesOneFile" />
78-
```
81+
Covered by `PSR2`
7982

8083
- Declare the class inheritance and all the implemented interfaces on the same line as the class name
8184

@@ -190,3 +193,55 @@ We added exceptions for param comments
190193
```
191194
<rule ref="Symfony3Custom.Commenting.DocCommentForbiddenTags" />
192195
```
196+
197+
## Others
198+
199+
- Add a single space after type casting
200+
201+
```
202+
<rule ref="Generic.Formatting.SpaceAfterCast"/>
203+
```
204+
205+
- Add a single space around assignement operator
206+
207+
```
208+
<rule ref="Symfony3Custom.WhiteSpace.AssignementSpacing"/>
209+
```
210+
211+
- Do not use spaces after `(` or `{` or before `)` or `}`
212+
213+
```
214+
<rule ref="Symfony3Custom.WhiteSpace.CloseBracketSpacing"/>
215+
<rule ref="Symfony3Custom.WhiteSpace.OpenBracketSpacing"/>
216+
```
217+
218+
- Do not use multiple following blank lines
219+
220+
```
221+
<rule ref="Symfony3Custom.WhiteSpace.EmptyLines"/>
222+
```
223+
224+
- Do not call functions with variables passed by reference
225+
226+
```
227+
<rule ref="Generic.Functions.CallTimePassByReference"/>
228+
```
229+
230+
- Use lowercase for PHP functions
231+
232+
```
233+
<rule ref="Squiz.PHP.LowercasePHPFunctions"/>
234+
```
235+
236+
- Variable and methods have scope modifier
237+
238+
```
239+
<rule ref="Squiz.Scope.MemberVarScope"/>
240+
<rule ref="Symfony3Custom.Scope.MethodScope"/>
241+
```
242+
243+
- No perl-style comments are used
244+
245+
```
246+
<rule ref="PEAR.Commenting.InlineComment"/>
247+
```

0 commit comments

Comments
 (0)