|
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" /> |
17 | 19 | </rule> |
18 | 20 |
|
19 | 21 | <!-- Also include PSR12 --> |
|
131 | 133 | </rule> |
132 | 134 | <!-- Require usage of ::class instead of __CLASS__, get_class(), get_class($this), get_called_class() and get_parent_class() --> |
133 | 135 | <rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/> |
| 136 | + <!-- Require use of constructor property promotion --> |
| 137 | + <rule ref="SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion" /> |
| 138 | + <!-- Forbid static:: in final class --> |
| 139 | + <rule ref="SlevomatCodingStandard.Classes.UselessLateStaticBinding" /> |
| 140 | + <!-- Forbid empty comments--> |
| 141 | + <rule ref="SlevomatCodingStandard.Commenting.EmptyComment" /> |
134 | 142 | <!-- report invalid format of inline phpDocs with @var --> |
135 | 143 | <rule ref="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration"/> |
| 144 | + <!-- Forbid useless function doc comments --> |
| 145 | + <rule ref="SlevomatCodingStandard.Commenting.UselessFunctionDocComment" /> |
136 | 146 | <!-- Forbid useless @inheritDoc comments --> |
137 | 147 | <rule ref="SlevomatCodingStandard.Commenting.UselessInheritDocComment"/> |
138 | 148 | <!-- Forbid assignments in conditions --> |
|
159 | 169 | <rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses"/> |
160 | 170 | <!-- Require usage of null coalesce operator when possible --> |
161 | 171 | <rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/> |
| 172 | + <!-- Require usage of null coalesce equal operator when possible --> |
| 173 | + <rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator"/> |
| 174 | + <!-- Require usage of null safe operator when possible --> |
| 175 | + <rule ref="SlevomatCodingStandard.ControlStructures.RequireNullSafeObjectOperator"/> |
162 | 176 | <!-- Require usage of ternary operator when possible --> |
163 | 177 | <rule ref="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator"> |
164 | 178 | <!-- But multiline is useful for readability --> |
165 | 179 | <properties> |
166 | 180 | <property name="ignoreMultiLine" value="true"/> |
167 | 181 | </properties> |
168 | 182 | </rule> |
| 183 | + <!-- Require Yoda comparisons --> |
| 184 | + <rule ref="SlevomatCodingStandard.ControlStructures.RequireYodaComparison"/> |
| 185 | + <!-- Formatting of arrow functions --> |
| 186 | + <rule ref="SlevomatCodingStandard.Functions.ArrowFunctionDeclaration" /> |
169 | 187 | <!-- Enforce consistent spacing of named arguments --> |
170 | 188 | <rule ref="SlevomatCodingStandard.Functions.NamedArgumentSpacing"/> |
171 | 189 | <!-- Require static closures for microoptimization --> |
|
237 | 255 | </properties> |
238 | 256 | </rule> |
239 | 257 | <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.UselessAnnotation"> |
240 | | - <severity>0</severity> |
| 258 | + <severity>9</severity> |
241 | 259 | </rule> |
242 | 260 | <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification"> |
243 | | - <severity>0</severity> |
| 261 | + <severity>9</severity> |
244 | 262 | </rule> |
245 | 263 | <!-- Require return type hints to be declared --> |
246 | 264 | <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint"> |
|
251 | 269 | </properties> |
252 | 270 | </rule> |
253 | 271 | <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.UselessAnnotation"> |
254 | | - <severity>0</severity> |
| 272 | + <severity>9</severity> |
255 | 273 | </rule> |
256 | 274 | <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification"> |
257 | | - <severity>0</severity> |
| 275 | + <severity>9</severity> |
| 276 | + </rule> |
| 277 | + <!-- Union type hint formatting --> |
| 278 | + <rule ref="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat"> |
| 279 | + <properties> |
| 280 | + <property name="withSpaces" value="yes"/> |
| 281 | + <property name="shortNullable" value="yes"/> |
| 282 | + <property name="nullPosition" value="last"/> |
| 283 | + </properties> |
258 | 284 | </rule> |
259 | 285 | <!-- Forbid useless @var for constants --> |
260 | 286 | <rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint"/> |
|
0 commit comments