|
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 --> |
|
237 | 257 | </properties> |
238 | 258 | </rule> |
239 | 259 | <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.UselessAnnotation"> |
240 | | - <severity>0</severity> |
| 260 | + <severity>9</severity> |
241 | 261 | </rule> |
242 | 262 | <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification"> |
243 | | - <severity>0</severity> |
| 263 | + <severity>9</severity> |
244 | 264 | </rule> |
245 | 265 | <!-- Require return type hints to be declared --> |
246 | 266 | <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint"> |
|
251 | 271 | </properties> |
252 | 272 | </rule> |
253 | 273 | <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.UselessAnnotation"> |
254 | | - <severity>0</severity> |
| 274 | + <severity>9</severity> |
255 | 275 | </rule> |
256 | 276 | <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification"> |
257 | | - <severity>0</severity> |
| 277 | + <severity>9</severity> |
| 278 | + </rule> |
| 279 | + <!-- DNF (union / intersection) type hint formatting --> |
| 280 | + <rule ref="SlevomatCodingStandard.TypeHints.DNFTypeHintFormat"> |
| 281 | + <properties> |
| 282 | + <property name="withSpacesAroundOperators" value="yes"/> |
| 283 | + <property name="withSpacesInsideParentheses" value="no"/> |
| 284 | + <property name="shortNullable" value="yes"/> |
| 285 | + <property name="nullPosition" value="last"/> |
| 286 | + </properties> |
258 | 287 | </rule> |
259 | 288 | <!-- Forbid useless @var for constants --> |
260 | 289 | <rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint"/> |
|
0 commit comments