|
11 | 11 | <exclude-pattern>*/typo3conf/ext/powermail/*</exclude-pattern>
|
12 | 12 | <exclude-pattern>*/typo3conf/ext/realurl/*</exclude-pattern>
|
13 | 13 |
|
| 14 | + <exclude-pattern>*/typo3conf/LocalConfiguration.php</exclude-pattern> |
| 15 | + <exclude-pattern>*/typo3conf/PackageStates.php</exclude-pattern> |
| 16 | + <!-- TCA files directly in TCA are generated by extension builder --> |
| 17 | + <exclude-pattern>*/Configuration/TCA/[^/]+.php</exclude-pattern> |
| 18 | +<!-- |
| 19 | + <exclude-pattern>*/typo3conf/ext/*/ext_*.php</exclude-pattern> |
| 20 | + <exclude-pattern>*/typo3conf/ext/*/Configuration/RequestMiddlewares.php</exclude-pattern> |
| 21 | + <exclude-pattern>*/typo3conf/AdditionalConfiguration*.php</exclude-pattern> |
| 22 | + --> |
| 23 | + <!-- TODO: Check https://github.com/consistence/coding-standard/blob/master/Consistence/ruleset.xml --> |
14 | 24 |
|
15 | 25 | <rule ref="SlevomatCodingStandard.Arrays" />
|
| 26 | + <rule ref="SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation"> |
| 27 | + <exclude-pattern>*/ext_emconf.php</exclude-pattern> |
| 28 | + </rule> |
16 | 29 |
|
17 | 30 |
|
18 | 31 | <rule ref="SlevomatCodingStandard.Commenting">
|
19 | 32 | <!-- TYPO3 extension builder generates multiline doc-comments -->
|
20 | 33 | <exclude name="SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment" />
|
21 | 34 |
|
22 | 35 | <exclude name="SlevomatCodingStandard.Commenting.DocCommentSpacing" />
|
| 36 | + <exclude name="SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment" /> |
23 | 37 | </rule>
|
24 | 38 | <rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations">
|
25 | 39 | <properties>
|
|
39 | 53 | <exclude name="SlevomatCodingStandard.ControlStructures.ControlStructureSpacing" />
|
40 | 54 | <exclude name="SlevomatCodingStandard.ControlStructures.DisallowEmpty" />
|
41 | 55 | <exclude name="SlevomatCodingStandard.ControlStructures.DisallowShortTernaryOperator" />
|
| 56 | + <exclude name="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison" /> |
| 57 | + <exclude name="SlevomatCodingStandard.ControlStructures.EarlyExit" /> |
42 | 58 | <exclude name="SlevomatCodingStandard.ControlStructures.NewWithoutParentheses" />
|
43 | 59 | <exclude name="SlevomatCodingStandard.ControlStructures.RequireMultiLineTernaryOperator" />
|
| 60 | + <exclude name="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator" /> |
| 61 | + <exclude name="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator" /> |
44 | 62 | <exclude name="SlevomatCodingStandard.ControlStructures.RequireYodaComparison" />
|
| 63 | + |
| 64 | + <!-- sometimes it is better to explicitly return true after a set of conditions which all return false... --> |
| 65 | + <exclude name="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn" /> |
| 66 | + </rule> |
| 67 | + <rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses"> |
| 68 | + <!-- Autogenerated code includes die() --> |
| 69 | + <exclude-pattern>*/typo3conf/*/TCA/*.php</exclude-pattern> |
45 | 70 | </rule>
|
46 | 71 |
|
47 | 72 |
|
48 | 73 | <rule ref="SlevomatCodingStandard.Classes">
|
| 74 | + <!-- Empty classes give an errors --> |
| 75 | + <exclude name="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces" /> |
| 76 | + |
49 | 77 | <!-- We use the name suffixes -->
|
50 | 78 | <exclude name="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming" />
|
51 | 79 | <exclude name="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming" />
|
|
54 | 82 |
|
55 | 83 | <!-- This only works in PHP >=7.1 -->
|
56 | 84 | <exclude name="SlevomatCodingStandard.Classes.ClassConstantVisibility" />
|
| 85 | + |
| 86 | + <!-- private methods can be called via magic __call or with a string... --> |
| 87 | + <exclude name="SlevomatCodingStandard.Classes.UnusedPrivateElements" /> |
| 88 | + |
| 89 | + <!-- ok, get_class($this) is ugly, but __CLASS__ is ok, I think --> |
| 90 | + <!-- SlevomatCodingStandard.Classes.ModernClassNameReference --> |
57 | 91 | </rule>
|
58 | 92 |
|
59 | 93 |
|
60 |
| - <rule ref="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces"> |
| 94 | + <!-- Empty classes give an errors --> |
| 95 | + <!-- <rule ref="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces"> |
61 | 96 | <properties>
|
62 | 97 | <property name="linesCountBeforeClosingBrace" value="0" />
|
63 | 98 | </properties>
|
64 |
| - </rule> |
65 |
| - |
66 |
| - |
67 |
| - <rule ref="SlevomatCodingStandard.Exceptions" /> |
| 99 | + </rule> --> |
68 | 100 |
|
69 | 101 |
|
70 | 102 | <rule ref="SlevomatCodingStandard.Functions">
|
|
84 | 116 | <exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions" />
|
85 | 117 | <exclude name="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces" />
|
86 | 118 | <exclude name="SlevomatCodingStandard.Namespaces.UseSpacing" />
|
| 119 | + |
| 120 | + <!-- Normally I would agree, but I like built-in names first (ZipArchive before user-land classes) --> |
| 121 | + <exclude name="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses" /> |
87 | 122 | </rule>
|
88 | 123 | <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
|
89 | 124 | <properties>
|
|
99 | 134 | <property name="allowFallbackGlobalFunctions" value="true" />
|
100 | 135 | <property name="allowFallbackGlobalConstants" value="true" />
|
101 | 136 | </properties>
|
| 137 | + |
| 138 | + <!-- TCA Code should use Fully-Qualified-ClassNames --> |
| 139 | + <exclude-pattern>*/Configuration/TCA/*.php</exclude-pattern> |
| 140 | + <exclude-pattern>*/ext_localconf.php</exclude-pattern> |
| 141 | + <exclude-pattern>*/ext_tables.php</exclude-pattern> |
| 142 | + <exclude-pattern>*/AdditionalConfiguration.php</exclude-pattern> |
| 143 | + <exclude-pattern>*/AdditionalConfiguration.sample.php</exclude-pattern> |
| 144 | + <exclude-pattern>*/database/*.php</exclude-pattern> |
102 | 145 | </rule>
|
103 | 146 |
|
104 | 147 |
|
105 | 148 | <rule ref="SlevomatCodingStandard.Operators.SpreadOperatorSpacing" />
|
106 | 149 |
|
107 | 150 |
|
108 |
| - <rule ref="SlevomatCodingStandard.PHP" /> |
| 151 | + <rule ref="SlevomatCodingStandard.PHP"> |
| 152 | + <exclude name="SlevomatCodingStandard.PHP.ShortList" /> |
| 153 | + </rule> |
109 | 154 |
|
110 | 155 |
|
111 | 156 | <rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints" />
|
|
123 | 168 | <exclude name="SlevomatCodingStandard.Variables.UselessVariable" />
|
124 | 169 | </rule>
|
125 | 170 | <rule ref="SlevomatCodingStandard.Variables.UnusedVariable">
|
| 171 | + <!-- |
| 172 | + TODO: Modify this rule to also ignore variables assigned in list(): |
| 173 | + `list($unused, $type) = explode(':', $string);` |
| 174 | + This can be used to document, what the first part contains |
| 175 | + --> |
126 | 176 | <properties>
|
127 | 177 | <property name="ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach" value="true" />
|
128 | 178 | </properties>
|
| 179 | + |
| 180 | + <exclude-pattern>*/database/*.php</exclude-pattern> |
129 | 181 | </rule>
|
130 | 182 |
|
131 | 183 |
|
|
139 | 191 | <exclude name="VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable" />
|
140 | 192 | <exclude name="VariableAnalysis.CodeAnalysis.VariableAnalysis.StaticOutsideClass" />
|
141 | 193 | </rule>
|
| 194 | + <rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis"> |
| 195 | + <!-- $_EXTKEY is pre-defined --> |
| 196 | + <properties> |
| 197 | + <property name="validUndefinedVariableNames" value="_EXTKEY EM_CONF TYPO3_CONF_VARS" /> |
| 198 | + </properties> |
| 199 | + </rule> |
142 | 200 |
|
143 | 201 | <!-- <rule ref="Generic.Arrays.DisallowLongArraySyntax" /> -->
|
144 | 202 | <!-- <rule ref="Generic.CodeAnalysis.EmptyStatement" /> -->
|
|
177 | 235 | </properties>
|
178 | 236 | </rule> -->
|
179 | 237 | <rule ref="Generic.NamingConventions.ConstructorName" />
|
180 |
| - <rule ref="Generic.NamingConventions.UpperCaseConstantName" /> |
| 238 | + <rule ref="Generic.NamingConventions.UpperCaseConstantName"> |
| 239 | + <exclude-pattern>*/Configuration/TCA/*.php</exclude-pattern> |
| 240 | + <exclude-pattern>*/database/*.php</exclude-pattern> |
| 241 | + </rule> |
181 | 242 |
|
182 | 243 | <rule ref="Generic.PHP.CharacterBeforePHPOpeningTag" />
|
183 | 244 | <rule ref="Generic.PHP.DeprecatedFunctions" />
|
|
0 commit comments