|
13 | 13 | ->setRules([ |
14 | 14 | '@PSR12' => true, |
15 | 15 | '@PER-CS' => true, |
16 | | - '@PHP82Migration' => true, |
| 16 | + '@PHP8x2Migration' => true, |
17 | 17 | 'trailing_comma_in_multiline' => false, |
18 | | - 'cast_spaces' => false, |
| 18 | + 'cast_spaces' => ['space' => 'none'], |
19 | 19 | 'single_line_empty_body' => false, |
20 | | - 'no_unused_imports' => true |
| 20 | + 'no_unused_imports' => true, |
| 21 | + // rules for phpdoc |
| 22 | + // Removes @param, @return and @var tags that don't provide any useful information - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:no_superfluous_phpdoc_tags |
| 23 | + 'no_superfluous_phpdoc_tags' => [ |
| 24 | + 'allow_mixed' => true, |
| 25 | + 'remove_inheritdoc' => true, |
| 26 | + ], |
| 27 | + // require phpdoc for non typed arguments - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_add_missing_param_annotation |
| 28 | + 'phpdoc_add_missing_param_annotation' => true, |
| 29 | + // no @access - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_no_access |
| 30 | + 'phpdoc_no_access' => true, |
| 31 | + // no @package - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_no_package |
| 32 | + 'phpdoc_no_package' => true, |
| 33 | + // order phpdoc tags - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_order |
| 34 | + 'phpdoc_order' => ['order' => ['since', 'var', 'see', 'param', 'return', 'throw', 'todo', 'deprecated']], |
| 35 | + // phpdoc param in same order as signature - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_param_order |
| 36 | + 'phpdoc_param_order' => true, |
| 37 | + // align tags - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_align |
| 38 | + 'phpdoc_align' => [ |
| 39 | + 'align' => 'vertical', |
| 40 | + 'tags' => [ |
| 41 | + 'param', |
| 42 | + 'property', |
| 43 | + 'property-read', |
| 44 | + 'property-write', |
| 45 | + 'phpstan-param', |
| 46 | + 'phpstan-property', |
| 47 | + 'phpstan-property-read', |
| 48 | + 'phpstan-property-write', |
| 49 | + 'phpstan-assert', |
| 50 | + 'phpstan-assert-if-true', |
| 51 | + 'phpstan-assert-if-false', |
| 52 | + 'psalm-param', |
| 53 | + 'psalm-param-out', |
| 54 | + 'psalm-property', |
| 55 | + 'psalm-property-read', |
| 56 | + 'psalm-property-write', |
| 57 | + 'psalm-assert', |
| 58 | + 'psalm-assert-if-true', |
| 59 | + 'psalm-assert-if-false' |
| 60 | + ], |
| 61 | + ], |
| 62 | + // Check types case - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_types |
| 63 | + 'phpdoc_types' => true, |
| 64 | + // Use native scalar types - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_scalar |
| 65 | + 'phpdoc_scalar' => true, |
| 66 | + // remove extra empty lines - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_trim |
| 67 | + 'phpdoc_trim' => true, |
| 68 | + // remove empty lines inside phpdoc block - https://mlocati.github.io/php-cs-fixer-configurator/#version:3.90|fixer:phpdoc_trim_consecutive_blank_line_separation |
| 69 | + 'phpdoc_trim_consecutive_blank_line_separation' => true, |
21 | 70 | ]) |
22 | 71 | ->setFinder($finder) |
23 | 72 | ; |
0 commit comments