|
14 | 14 | <!-- exclude sniffs that are disabled on purpose by this standard -->
|
15 | 15 | <exclude name="Symfony.Commenting.ClassComment.Missing"/>
|
16 | 16 | <exclude name="Symfony.Commenting.License"/>
|
| 17 | + <!-- SlevomatCodingStandard.ControlStructures.RequireYodaComparison supports autofixing --> |
| 18 | + <exclude name="Symfony.ControlStructure.YodaConditions.Invalid"/> |
| 19 | + <!-- disable forcing of function type hints as we're requiring native types --> |
| 20 | + <exclude name="Symfony.Commenting.FunctionComment"/> |
17 | 21 | </rule>
|
18 | 22 |
|
19 | 23 | <!-- Also include PSR12 -->
|
|
131 | 135 | </rule>
|
132 | 136 | <!-- Require usage of ::class instead of __CLASS__, get_class(), get_class($this), get_called_class() and get_parent_class() -->
|
133 | 137 | <rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/>
|
| 138 | + <!-- Require use of constructor property promotion --> |
| 139 | + <rule ref="SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion"/> |
| 140 | + <!-- Forbid static:: in final class --> |
| 141 | + <rule ref="SlevomatCodingStandard.Classes.UselessLateStaticBinding"/> |
| 142 | + <!-- Forbid empty comments--> |
| 143 | + <rule ref="SlevomatCodingStandard.Commenting.EmptyComment"/> |
134 | 144 | <!-- report invalid format of inline phpDocs with @var -->
|
135 | 145 | <rule ref="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration"/>
|
| 146 | + <!-- Forbid useless function doc comments --> |
| 147 | + <rule ref="SlevomatCodingStandard.Commenting.UselessFunctionDocComment"/> |
136 | 148 | <!-- Forbid useless @inheritDoc comments -->
|
137 | 149 | <rule ref="SlevomatCodingStandard.Commenting.UselessInheritDocComment"/>
|
138 | 150 | <!-- Forbid assignments in conditions -->
|
|
159 | 171 | <rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses"/>
|
160 | 172 | <!-- Require usage of null coalesce operator when possible -->
|
161 | 173 | <rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/>
|
| 174 | + <!-- Require usage of null coalesce equal operator when possible --> |
| 175 | + <rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator"/> |
| 176 | + <!-- Require usage of null safe operator when possible --> |
| 177 | + <rule ref="SlevomatCodingStandard.ControlStructures.RequireNullSafeObjectOperator"/> |
162 | 178 | <!-- Require usage of ternary operator when possible -->
|
163 | 179 | <rule ref="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator">
|
164 | 180 | <!-- But multiline is useful for readability -->
|
165 | 181 | <properties>
|
166 | 182 | <property name="ignoreMultiLine" value="true"/>
|
167 | 183 | </properties>
|
168 | 184 | </rule>
|
| 185 | + <!-- Require Yoda comparisons --> |
| 186 | + <rule ref="SlevomatCodingStandard.ControlStructures.RequireYodaComparison"/> |
| 187 | + <!-- Formatting of arrow functions --> |
| 188 | + <rule ref="SlevomatCodingStandard.Functions.ArrowFunctionDeclaration"/> |
169 | 189 | <!-- Enforce consistent spacing of named arguments -->
|
170 | 190 | <rule ref="SlevomatCodingStandard.Functions.NamedArgumentSpacing"/>
|
171 | 191 | <!-- Require static closures for microoptimization -->
|
|
229 | 249 | <!-- Require one space after and no space before colon in return types -->
|
230 | 250 | <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/>
|
231 | 251 | <!-- Require parameter type hints to be declared -->
|
232 |
| - <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint"> |
233 |
| - <properties> |
234 |
| - <property name="enableMixedTypeHint" value="false"/> |
235 |
| - <property name="enableUnionTypeHint" value="false"/> |
236 |
| - <property name="enableIntersectionTypeHint" value="false"/> |
237 |
| - </properties> |
238 |
| - </rule> |
| 252 | + <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint"/> |
239 | 253 | <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.UselessAnnotation">
|
240 |
| - <severity>0</severity> |
| 254 | + <severity>9</severity> |
241 | 255 | </rule>
|
242 | 256 | <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification">
|
243 |
| - <severity>0</severity> |
| 257 | + <severity>9</severity> |
244 | 258 | </rule>
|
| 259 | + <!-- check spacing of parameter type hints --> |
| 260 | + <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/> |
245 | 261 | <!-- Require return type hints to be declared -->
|
246 | 262 | <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
|
247 | 263 | <properties>
|
|
251 | 267 | </properties>
|
252 | 268 | </rule>
|
253 | 269 | <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.UselessAnnotation">
|
254 |
| - <severity>0</severity> |
| 270 | + <severity>9</severity> |
255 | 271 | </rule>
|
256 | 272 | <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification">
|
257 |
| - <severity>0</severity> |
| 273 | + <severity>9</severity> |
| 274 | + </rule> |
| 275 | + <!-- check spacing of return type hints --> |
| 276 | + <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/> |
| 277 | + <!-- DNF (union / intersection) type hint formatting --> |
| 278 | + <rule ref="SlevomatCodingStandard.TypeHints.DNFTypeHintFormat"> |
| 279 | + <properties> |
| 280 | + <property name="withSpacesAroundOperators" value="no"/> |
| 281 | + <property name="withSpacesInsideParentheses" value="no"/> |
| 282 | + <property name="shortNullable" value="yes"/> |
| 283 | + <property name="nullPosition" value="last"/> |
| 284 | + </properties> |
258 | 285 | </rule>
|
259 | 286 | <!-- Forbid useless @var for constants -->
|
260 | 287 | <rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint"/>
|
|
0 commit comments