|
1 | 1 | <?xml version="1.0"?> |
2 | 2 | <ruleset name="Slevomat Sniffs"> |
3 | 3 |
|
4 | | - <!-- |
5 | | - composer require slevomat/coding-standard - -dev |
6 | | - --> |
7 | | - <description>Selected Slevomat Coding Standard Sniffs (PHP 7.2+)</description> |
8 | | - |
9 | | - <!-- |
10 | | - ComposerScripts::postUpdate will update this |
11 | | - --> |
12 | | - <config name="installed_paths" value="vendor/slevomat/coding-standard" /> |
13 | | - |
14 | | - <rule ref="SlevomatCodingStandard.Arrays" /> |
15 | | - |
16 | | - <rule ref="SlevomatCodingStandard.Classes.ClassStructure"> |
17 | | - <properties> |
18 | | - <property name="groups" type="array"> |
19 | | - <element value="uses" /> |
20 | | - <element value="public constants" /> |
21 | | - <element value="protected constants" /> |
22 | | - <element value="private constants" /> |
23 | | - <element value="enum cases" /> |
24 | | - <element value="public static properties, public properties" /> |
25 | | - <element value="protected properties, protected static properties, private properties, private static properties" /> |
26 | | - <element value="constructor" /> |
27 | | - <element value="destructor, magic methods" /> |
28 | | - <element value="public methods, public static methods, static constructors, public abstract methods, public static abstract methods, public static final methods, public final methods" /> |
29 | | - <element value="protected methods, protected static methods, private methods, private static methods, protected abstract methods, protected static abstract methods, protected static final methods, protected final methods" /> |
30 | | - </property> |
31 | | - </properties> |
32 | | - </rule> |
33 | | - <rule ref="SlevomatCodingStandard.Classes.MethodSpacing" /> |
34 | | - <rule ref="SlevomatCodingStandard.Classes.TraitUseDeclaration" /> |
35 | | - <rule ref="SlevomatCodingStandard.Classes.UselessLateStaticBinding" /> |
36 | | - |
37 | | - <rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments"> |
38 | | - <properties> |
39 | | - <property name="forbiddenCommentPatterns" type="array"> |
40 | | - <element value="#\[\w*\s+description\]#" /> |
41 | | - <element value="#^Undocumented \w+$#" /> |
42 | | - </property> |
43 | | - </properties> |
44 | | - </rule> |
45 | | - |
46 | | - <rule ref="SlevomatCodingStandard.Complexity.Cognitive"> |
47 | | - <properties> |
48 | | - <property name="warningThreshold" value="6" /> |
49 | | - <property name="errorThreshold" value="10" /> |
50 | | - </properties> |
51 | | - </rule> |
52 | | - |
53 | | - <rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses" /> |
54 | | - <rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses" /> |
55 | | - <rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn" /> |
56 | | - <rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator" /> |
57 | | - |
58 | | - <rule ref="SlevomatCodingStandard.Exceptions.DeadCatch"> |
59 | | - <exclude name="SlevomatCodingStandard.Exceptions.DeadCatch.CatchAfterThrowableCatch" /> |
60 | | - </rule> |
61 | | - |
62 | | - <rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure" /> |
63 | | - <rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue" /> |
64 | | - <rule ref="SlevomatCodingStandard.Functions.FunctionLength"> |
65 | | - <properties> |
66 | | - <property name="maxLinesLength" value="25" /> |
67 | | - </properties> |
68 | | - </rule> |
69 | | - <rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall" /> |
70 | | - <rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInClosureUse" /> |
71 | | - <rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration" /> |
72 | | - <rule ref="SlevomatCodingStandard.Functions.StaticClosure" /> |
73 | | - <rule ref="SlevomatCodingStandard.Functions.StrictCall" /> |
74 | | - |
75 | | - <rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses" /> |
76 | | - <rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions" /> |
77 | | - <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"> |
78 | | - <properties> |
79 | | - <property name="searchAnnotations" value="true" /> |
80 | | - </properties> |
81 | | - </rule> |
82 | | - <rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash" /> |
83 | | - <rule ref="SlevomatCodingStandard.Namespaces.UselessAlias" /> |
84 | | - <rule ref="SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking" /> |
85 | | - <rule ref="SlevomatCodingStandard.PHP.RequireExplicitAssertion" /> |
86 | | - <rule ref="SlevomatCodingStandard.PHP.UselessParentheses" /> |
87 | | - <rule ref="SlevomatCodingStandard.PHP.UselessSemicolon" /> |
88 | | - <rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable" /> |
89 | | - <rule ref="SlevomatCodingStandard.Variables.UnusedVariable" /> |
90 | | - <rule ref="SlevomatCodingStandard.Variables.UselessVariable" /> |
91 | | - |
92 | | - <rule ref="SlevomatCodingStandard.Files.FileLength"> |
93 | | - <properties> |
94 | | - <property name="maxLinesLength" value="250" /> |
95 | | - </properties> |
96 | | - </rule> |
97 | | - <!-- |
98 | | - <rule ref="SlevomatCodingStandard.Classes.ClassLength"> |
99 | | - <properties> |
100 | | - <property name="maxLinesLength" value="250" /> |
101 | | - </properties> |
102 | | - </rule> |
103 | | - --> |
104 | | - |
105 | | - <!-- |
106 | | - <rule ref="SlevomatCodingStandard.Functions.StaticClosure" /> |
107 | | -
|
108 | | - Rule seems to be broken on codacy.. |
109 | | - Not necessary to catch here... will be caught by unit test |
110 | | - <rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName"> |
111 | | - <properties> |
112 | | - <property name="rootNamespaces" type="array"> |
113 | | - <element key="src" value="bdk"/> |
114 | | - </property> |
115 | | - </properties> |
116 | | - <exclude-pattern>src/Backtrace/Backtrace.php</exclude-pattern> |
117 | | - <exclude-pattern>src/Debug/Debug.php</exclude-pattern> |
118 | | - <exclude-pattern>src/ErrorHandler/ErrorHandler.php</exclude-pattern> |
119 | | - </rule> |
120 | | -
|
121 | | - <rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations"> |
122 | | - <property name="forbiddenAnnotations" type="array"> |
123 | | - <element value="@author, @created, @version, @package, @copyright, @license, @throws" /> |
124 | | - </property> |
125 | | - </rule> |
126 | | - --> |
| 4 | + <!-- |
| 5 | + composer require slevomat/coding-standard - -dev |
| 6 | + --> |
| 7 | + <description>Selected Slevomat Coding Standard Sniffs (PHP 7.2+)</description> |
| 8 | + |
| 9 | + <!-- |
| 10 | + ComposerScripts::postUpdate will update this |
| 11 | + --> |
| 12 | + <config name="installed_paths" value="vendor/slevomat/coding-standard" /> |
| 13 | + |
| 14 | + <rule ref="SlevomatCodingStandard.Arrays" /> |
| 15 | + |
| 16 | + <rule ref="SlevomatCodingStandard.Classes.ClassStructure"> |
| 17 | + <properties> |
| 18 | + <property name="groups" type="array"> |
| 19 | + <element value="uses" /> |
| 20 | + <element value="public constants" /> |
| 21 | + <element value="protected constants" /> |
| 22 | + <element value="private constants" /> |
| 23 | + <element value="enum cases" /> |
| 24 | + <element value="public static properties, public properties" /> |
| 25 | + <element value="protected properties, protected static properties, private properties, private static properties" /> |
| 26 | + <element value="constructor" /> |
| 27 | + <element value="destructor, magic methods" /> |
| 28 | + <element value="public methods, public static methods, static constructors, public abstract methods, public static abstract methods, public static final methods, public final methods" /> |
| 29 | + <element value="protected methods, protected static methods, private methods, private static methods, protected abstract methods, protected static abstract methods, protected static final methods, protected final methods" /> |
| 30 | + </property> |
| 31 | + </properties> |
| 32 | + </rule> |
| 33 | + <rule ref="SlevomatCodingStandard.Classes.MethodSpacing" /> |
| 34 | + <rule ref="SlevomatCodingStandard.Classes.TraitUseDeclaration" /> |
| 35 | + <rule ref="SlevomatCodingStandard.Classes.UselessLateStaticBinding" /> |
| 36 | + |
| 37 | + <rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments"> |
| 38 | + <properties> |
| 39 | + <property name="forbiddenCommentPatterns" type="array"> |
| 40 | + <element value="#\[\w*\s+description\]#" /> |
| 41 | + <element value="#^Undocumented \w+$#" /> |
| 42 | + </property> |
| 43 | + </properties> |
| 44 | + </rule> |
| 45 | + |
| 46 | + <rule ref="SlevomatCodingStandard.Complexity.Cognitive"> |
| 47 | + <properties> |
| 48 | + <property name="warningThreshold" value="6" /> |
| 49 | + <property name="errorThreshold" value="10" /> |
| 50 | + </properties> |
| 51 | + </rule> |
| 52 | + |
| 53 | + <rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses" /> |
| 54 | + <rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses" /> |
| 55 | + <rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn" /> |
| 56 | + <rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator" /> |
| 57 | + |
| 58 | + <rule ref="SlevomatCodingStandard.Exceptions.DeadCatch"> |
| 59 | + <exclude name="SlevomatCodingStandard.Exceptions.DeadCatch.CatchAfterThrowableCatch" /> |
| 60 | + </rule> |
| 61 | + |
| 62 | + <rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure" /> |
| 63 | + <rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue" /> |
| 64 | + <rule ref="SlevomatCodingStandard.Functions.FunctionLength"> |
| 65 | + <properties> |
| 66 | + <property name="maxLinesLength" value="25" /> |
| 67 | + </properties> |
| 68 | + </rule> |
| 69 | + <rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall" /> |
| 70 | + <rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInClosureUse" /> |
| 71 | + <rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration" /> |
| 72 | + <rule ref="SlevomatCodingStandard.Functions.StaticClosure" /> |
| 73 | + <rule ref="SlevomatCodingStandard.Functions.StrictCall" /> |
| 74 | + |
| 75 | + <rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses" /> |
| 76 | + <rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions" /> |
| 77 | + <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"> |
| 78 | + <properties> |
| 79 | + <property name="searchAnnotations" value="true" /> |
| 80 | + </properties> |
| 81 | + </rule> |
| 82 | + <rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash" /> |
| 83 | + <rule ref="SlevomatCodingStandard.Namespaces.UselessAlias" /> |
| 84 | + <rule ref="SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking" /> |
| 85 | + <rule ref="SlevomatCodingStandard.PHP.RequireExplicitAssertion" /> |
| 86 | + <rule ref="SlevomatCodingStandard.PHP.UselessParentheses" /> |
| 87 | + <rule ref="SlevomatCodingStandard.PHP.UselessSemicolon" /> |
| 88 | + <rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable" /> |
| 89 | + <rule ref="SlevomatCodingStandard.Variables.UnusedVariable" /> |
| 90 | + <rule ref="SlevomatCodingStandard.Variables.UselessVariable" /> |
| 91 | + |
| 92 | + <rule ref="SlevomatCodingStandard.Files.FileLength"> |
| 93 | + <properties> |
| 94 | + <property name="maxLinesLength" value="250" /> |
| 95 | + </properties> |
| 96 | + </rule> |
| 97 | + <!-- |
| 98 | + <rule ref="SlevomatCodingStandard.Classes.ClassLength"> |
| 99 | + <properties> |
| 100 | + <property name="maxLinesLength" value="250" /> |
| 101 | + </properties> |
| 102 | + </rule> |
| 103 | + --> |
| 104 | + |
| 105 | + <!-- |
| 106 | + <rule ref="SlevomatCodingStandard.Functions.StaticClosure" /> |
| 107 | +
|
| 108 | + Rule seems to be broken on codacy.. |
| 109 | + Not necessary to catch here... will be caught by unit test |
| 110 | + <rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName"> |
| 111 | + <properties> |
| 112 | + <property name="rootNamespaces" type="array"> |
| 113 | + <element key="src" value="bdk"/> |
| 114 | + </property> |
| 115 | + </properties> |
| 116 | + <exclude-pattern>src/Backtrace/Backtrace.php</exclude-pattern> |
| 117 | + <exclude-pattern>src/Debug/Debug.php</exclude-pattern> |
| 118 | + <exclude-pattern>src/ErrorHandler/ErrorHandler.php</exclude-pattern> |
| 119 | + </rule> |
| 120 | +
|
| 121 | + <rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations"> |
| 122 | + <property name="forbiddenAnnotations" type="array"> |
| 123 | + <element value="@author, @created, @version, @package, @copyright, @license, @throws" /> |
| 124 | + </property> |
| 125 | + </rule> |
| 126 | + --> |
| 127 | + |
| 128 | + <rule ref="SlevomatCodingStandard.Files.FileLength"> |
| 129 | + <exclude-pattern>*/src/Debug/Dump/charData.php</exclude-pattern> |
| 130 | + </rule> |
| 131 | + |
| 132 | + <rule ref="SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys"> |
| 133 | + <exclude-pattern>*/src/Debug/Dump/charData.php</exclude-pattern> |
| 134 | + </rule> |
127 | 135 |
|
128 | 136 | </ruleset> |
0 commit comments