|
224 | 224 | <!-- Require usage of null coalesce operator when possible --> |
225 | 225 | <rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/> |
226 | 226 |
|
227 | | - <!-- Forbid usage of conditions when a simple return can be used --> |
228 | | - <rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn"/> |
229 | | - |
230 | 227 | <!-- Forbid usage of boolean-only ternary operator usage (e.g. $foo ? true : false) --> |
231 | 228 | <rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator"/> |
232 | 229 |
|
|
346 | 343 | <!-- Require one space between typehint and variable, require no space between nullability sign and typehint --> |
347 | 344 | <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/> |
348 | 345 |
|
349 | | - <!-- Require types to be written as natively if possible; |
350 | | - require iterable types to specify phpDoc with their content; |
351 | | - forbid useless/duplicated information in phpDoc --> |
352 | | - <rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration"> |
353 | | - <properties> |
354 | | - <property name="allAnnotationsAreUseful" value="true"/> |
355 | | - <property name="enableEachParameterAndReturnInspection" value="true"/> |
356 | | - </properties> |
357 | | - </rule> |
358 | | - |
359 | 346 | <!-- Forbid useless @var for constants --> |
360 | 347 | <rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint"/> |
361 | 348 |
|
|
374 | 361 | <!-- Force `self::` for self-reference, force lower-case self, forbid spaces around `::` --> |
375 | 362 | <rule ref="Squiz.Classes.SelfMemberReference"/> |
376 | 363 |
|
377 | | - <!-- Force rules for function phpDoc --> |
378 | | - <rule ref="Squiz.Commenting.FunctionComment"> |
379 | | - <!-- Allow `@throws` without description --> |
380 | | - <exclude name="Squiz.Commenting.FunctionComment.EmptyThrows"/> |
381 | | - <!-- Does not work properly with PHP 7 / short-named types --> |
382 | | - <exclude name="Squiz.Commenting.FunctionComment.IncorrectParamVarName"/> |
383 | | - <!-- Does not support collections, i.e. `string[]` --> |
384 | | - <exclude name="Squiz.Commenting.FunctionComment.IncorrectTypeHint"/> |
385 | | - <!-- Forces incorrect types --> |
386 | | - <exclude name="Squiz.Commenting.FunctionComment.InvalidReturn"/> |
387 | | - <!-- Breaks with compound return types, i.e. `string|null` --> |
388 | | - <exclude name="Squiz.Commenting.FunctionComment.InvalidReturnNotVoid"/> |
389 | | - <!-- Breaks when all params are not documented --> |
390 | | - <exclude name="Squiz.Commenting.FunctionComment.InvalidTypeHint"/> |
391 | | - <!-- Doc comment is not required for every method --> |
392 | | - <exclude name="Squiz.Commenting.FunctionComment.Missing"/> |
393 | | - <!-- Do not require comments for `@param` --> |
394 | | - <exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/> |
395 | | - <!-- Do not require `@param` for all parameters --> |
396 | | - <exclude name="Squiz.Commenting.FunctionComment.MissingParamTag"/> |
397 | | - <!-- Do not require `@return` for void methods --> |
398 | | - <exclude name="Squiz.Commenting.FunctionComment.MissingReturn"/> |
399 | | - <!-- Comments don't have to be sentences --> |
400 | | - <exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/> |
401 | | - <!-- Comments don't have to be sentences --> |
402 | | - <exclude name="Squiz.Commenting.FunctionComment.ParamCommentNotCapital"/> |
403 | | - <!-- Breaks when all params are not documented --> |
404 | | - <exclude name="Squiz.Commenting.FunctionComment.ParamNameNoMatch"/> |
405 | | - <!-- Doesn't respect inheritance --> |
406 | | - <exclude name="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing"/> |
407 | | - <!-- `@throws` lines can often be read as a sentence, |
408 | | - i.e. `@throws RuntimeException if the file could not be written.` --> |
409 | | - <exclude name="Squiz.Commenting.FunctionComment.ThrowsNotCapital"/> |
410 | | - <!-- Doesn't work with self as typehint --> |
411 | | - <exclude name="Squiz.Commenting.FunctionComment.TypeHintMissing"/> |
412 | | - </rule> |
413 | | - |
414 | 364 | <!-- Forbid global functions --> |
415 | 365 | <rule ref="Squiz.Functions.GlobalFunction"/> |
416 | 366 |
|
|
0 commit comments