|
1 | 1 | # Coding Standard Rules
|
2 |
| -## General |
3 |
| -We added |
4 |
| -- `PSR1` and `PSR2` rules |
| 2 | +## From PSR2 |
5 | 3 |
|
6 |
| -- All `Zend` rules except: |
| 4 | +@TODO |
| 5 | + |
| 6 | +## From Zend |
| 7 | + |
| 8 | +@TODO |
7 | 9 |
|
8 | 10 | ```
|
9 |
| -<rule ref="Zend.NamingConventions.ValidVariableName.PrivateNoUnderscore"> |
10 |
| - <severity>0</severity> |
| 11 | +<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"> |
| 12 | + <exclude name="Generic.Functions.OpeningFunctionBraceBsdAllman.BraceOnSameLine"/> |
11 | 13 | </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"/> |
15 | 20 | </rule>
|
16 | 21 | ```
|
17 | 22 |
|
@@ -73,9 +78,7 @@ Covered by `PSR2`
|
73 | 78 |
|
74 | 79 | - Define one class per file
|
75 | 80 |
|
76 |
| -``` |
77 |
| -<rule ref="Symfony3Custom.Classes.MultipleClassesOneFile" /> |
78 |
| -``` |
| 81 | +Covered by `PSR2` |
79 | 82 |
|
80 | 83 | - Declare the class inheritance and all the implemented interfaces on the same line as the class name
|
81 | 84 |
|
@@ -190,3 +193,55 @@ We added exceptions for param comments
|
190 | 193 | ```
|
191 | 194 | <rule ref="Symfony3Custom.Commenting.DocCommentForbiddenTags" />
|
192 | 195 | ```
|
| 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