|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
2 | 2 | <ruleset name="Yii2">
|
3 |
| - <description>Yii 2 Web Application Framework Coding Standard</description> |
| 3 | + <description>Yii 2 Web Application Framework Coding Standard</description> |
4 | 4 |
|
5 |
| - <rule ref="PSR2"> |
6 |
| - <!-- Property names MUST start with an initial underscore if they are private. --> |
7 |
| - <exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/> |
| 5 | + <rule ref="PSR2"> |
| 6 | + <!-- Property names MUST start with an initial underscore if they are private. --> |
| 7 | + <exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/> |
8 | 8 |
|
9 |
| - <!-- Opening parenthesis of a multi-line function call must be the last content on the line. --> |
10 |
| - <!-- Closing parenthesis of a multi-line function call must be on a line by itself. --> |
11 |
| - <!-- Only one argument is allowed per line in a multi-line function call. --> |
12 |
| - <exclude name="PEAR.Functions.FunctionCallSignature"/> |
| 9 | + <!-- Opening parenthesis of a multi-line function call must be the last content on the line. --> |
| 10 | + <!-- Closing parenthesis of a multi-line function call must be on a line by itself. --> |
| 11 | + <!-- Only one argument is allowed per line in a multi-line function call. --> |
| 12 | + <exclude name="PEAR.Functions.FunctionCallSignature"/> |
13 | 13 |
|
14 |
| - <!-- We don't have line length (line width) limits. --> |
15 |
| - <exclude name="Generic.Files.LineLength"/> |
| 14 | + <!-- We don't have line length (line width) limits. --> |
| 15 | + <exclude name="Generic.Files.LineLength"/> |
16 | 16 |
|
17 |
| - <!-- CASE keyword must be indented 4 spaces from SWITCH keyword. --> |
18 |
| - <exclude name="PSR2.ControlStructures.SwitchDeclaration"/> |
19 |
| - </rule> |
| 17 | + <!-- CASE keyword must be indented 4 spaces from SWITCH keyword. --> |
| 18 | + <exclude name="PSR2.ControlStructures.SwitchDeclaration"/> |
| 19 | + </rule> |
20 | 20 |
|
21 |
| - <!-- Property declaration rules. --> |
22 |
| - <!-- TODO: --> |
| 21 | + <!-- Property declaration rules. --> |
| 22 | + <!-- TODO: --> |
23 | 23 |
|
24 |
| - <!-- Function call signature. --> |
25 |
| - <!-- TODO: --> |
| 24 | + <!-- Function call signature. --> |
| 25 | + <!-- TODO: --> |
26 | 26 |
|
27 |
| - <!-- Switch declaration. --> |
28 |
| - <!-- TODO: --> |
| 27 | + <!-- Switch declaration. --> |
| 28 | + <!-- TODO: --> |
29 | 29 |
|
30 |
| - <!-- ... other Yii2 specific rules. --> |
31 |
| - <rule ref="Generic.Arrays.DisallowLongArraySyntax"/> |
| 30 | + <!-- ... other Yii2 specific rules. --> |
| 31 | + <rule ref="Generic.Arrays.DisallowLongArraySyntax"/> |
32 | 32 |
|
33 |
| - <!-- If string doesn't contain variables or single quotes, use single quotes. --> |
34 |
| - <rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar"> |
35 |
| - <!-- Not check variable substitution --> |
36 |
| - <severity>0</severity> |
37 |
| - </rule> |
| 33 | + <!-- If string doesn't contain variables or single quotes, use single quotes. --> |
| 34 | + <rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar"> |
| 35 | + <!-- Not check variable substitution --> |
| 36 | + <severity>0</severity> |
| 37 | + </rule> |
38 | 38 |
|
39 |
| - <exclude-pattern>*/i18n/data/*</exclude-pattern> |
40 |
| - <exclude-pattern>*/views/errorHandler/*</exclude-pattern> |
41 |
| - <exclude-pattern>*/requirements/*</exclude-pattern> |
| 39 | + <!-- Ignore for migrations. --> |
| 40 | + <!-- Ignore missing namespace for migrations --> |
| 41 | + <rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace"> |
| 42 | + <exclude-pattern>m\d{6}_\d{6}_.+\.php$</exclude-pattern> |
| 43 | + </rule> |
| 44 | + <!-- Ignore camel caps format for class name of migrations --> |
| 45 | + <rule ref="Squiz.Classes.ValidClassName.NotCamelCaps"> |
| 46 | + <exclude-pattern>m\d{6}_\d{6}_.+\.php$</exclude-pattern> |
| 47 | + </rule> |
42 | 48 |
|
43 |
| - <exclude-pattern>ProfileTarget.php</exclude-pattern> |
| 49 | + <!-- Ignore for tests. --> |
| 50 | + <!-- Ignore method name prefixed with underscore to indicate visibility --> |
| 51 | + <rule ref="PSR2.Methods.MethodDeclaration.Underscore"> |
| 52 | + <exclude-pattern>tests?/*(Cest|Test).php$</exclude-pattern> |
| 53 | + </rule> |
| 54 | + <!-- Ignore declare new symbols and execute logic with side effects same file --> |
| 55 | + <rule ref="PSR1.Files.SideEffects.FoundWithSymbols"> |
| 56 | + <exclude-pattern>/tests?*/_bootstrap.php$</exclude-pattern> |
| 57 | + <exclude-pattern>/web/(index|index-test).php$</exclude-pattern> |
| 58 | + </rule> |
| 59 | + |
| 60 | + <exclude-pattern>*/i18n/data/*</exclude-pattern> |
| 61 | + <exclude-pattern>*/views/errorHandler/*</exclude-pattern> |
| 62 | + <exclude-pattern>*/requirements/*</exclude-pattern> |
| 63 | + |
| 64 | + <exclude-pattern>ProfileTarget.php</exclude-pattern> |
44 | 65 | </ruleset>
|
0 commit comments