|
6 | 6 | <<<EOM |
7 | 7 | This file is part of the TYPO3 project. |
8 | 8 |
|
9 | | - (c) 2019-2024 Benni Mack |
| 9 | + (c) 2019-2026 Benni Mack |
10 | 10 | Simon Gilli |
11 | 11 |
|
12 | 12 | For the full copyright and license information, please view |
|
17 | 17 | true |
18 | 18 | ) |
19 | 19 | ->addRules([ |
20 | | - '@PER:risky' => true, |
21 | | - '@PHP80Migration:risky' => true, |
22 | | - '@PHP81Migration' => true, |
23 | | - 'declare_strict_types' => true, |
24 | | - 'fully_qualified_strict_types' => true, |
| 20 | + '@DoctrineAnnotation' => true, |
| 21 | + '@PER-CS3x0' => true, |
| 22 | + // Override PER-CS3x0 default (single) to keep no space after cast operators |
| 23 | + 'cast_spaces' => ['space' => 'none'], |
| 24 | + 'declare_parentheses' => true, |
| 25 | + 'dir_constant' => true, |
| 26 | + 'function_to_constant' => [ |
| 27 | + 'functions' => [ |
| 28 | + 'get_called_class', |
| 29 | + 'get_class', |
| 30 | + 'get_class_this', |
| 31 | + 'php_sapi_name', |
| 32 | + 'phpversion', |
| 33 | + 'pi', |
| 34 | + ], |
| 35 | + ], |
| 36 | + 'type_declaration_spaces' => true, |
25 | 37 | 'global_namespace_import' => [ |
26 | | - 'import_classes' => true, |
| 38 | + 'import_classes' => false, |
27 | 39 | 'import_constants' => false, |
28 | 40 | 'import_functions' => false, |
29 | 41 | ], |
30 | | - 'no_unneeded_import_alias' => true, |
31 | | - 'ordered_imports' => [ |
32 | | - 'imports_order' => ['class', 'function', 'const'], |
33 | | - 'sort_algorithm' => 'alpha', |
| 42 | + 'list_syntax' => ['syntax' => 'short'], |
| 43 | + 'modernize_strpos' => true, |
| 44 | + 'modernize_types_casting' => true, |
| 45 | + 'native_function_casing' => true, |
| 46 | + 'native_function_invocation' => [ |
| 47 | + 'include' => [], |
| 48 | + 'scope' => 'all', |
| 49 | + 'strict' => true, |
34 | 50 | ], |
35 | | - 'phpdoc_align' => true, |
36 | | - 'phpdoc_annotation_without_dot' => true, |
37 | | - 'phpdoc_indent' => true, |
38 | | - 'phpdoc_inline_tag_normalizer' => true, |
39 | | - 'phpdoc_line_span' => true, |
40 | | - 'phpdoc_no_useless_inheritdoc' => true, |
41 | | - 'phpdoc_order' => true, |
42 | | - 'phpdoc_order_by_value' => true, |
43 | | - 'phpdoc_separation' => true, |
44 | | - 'phpdoc_single_line_var_spacing' => true, |
45 | | - 'phpdoc_summary' => true, |
46 | | - 'phpdoc_tag_casing' => true, |
47 | | - 'phpdoc_tag_type' => true, |
48 | | - 'phpdoc_to_comment' => [ |
49 | | - 'ignored_tags' => [ |
50 | | - 'phpstan-ignore-line', |
51 | | - 'phpstan-ignore-next-line', |
52 | | - 'todo', |
53 | | - ], |
| 51 | + 'no_alias_functions' => true, |
| 52 | + 'no_blank_lines_after_phpdoc' => true, |
| 53 | + 'no_empty_phpdoc' => true, |
| 54 | + 'no_empty_statement' => true, |
| 55 | + 'no_extra_blank_lines' => true, |
| 56 | + 'no_leading_namespace_whitespace' => true, |
| 57 | + 'no_null_property_initialization' => true, |
| 58 | + 'no_short_bool_cast' => true, |
| 59 | + 'no_singleline_whitespace_before_semicolons' => true, |
| 60 | + 'no_superfluous_elseif' => true, |
| 61 | + 'no_trailing_comma_in_singleline' => true, |
| 62 | + 'no_unneeded_control_parentheses' => true, |
| 63 | + 'no_unused_imports' => true, |
| 64 | + 'no_useless_else' => true, |
| 65 | + 'no_useless_nullsafe_operator' => true, |
| 66 | + // Override PER-CS3x0 default (union) to keep ?Type shorthand syntax |
| 67 | + 'nullable_type_declaration' => [ |
| 68 | + 'syntax' => 'question_mark', |
54 | 69 | ], |
55 | | - 'phpdoc_trim_consecutive_blank_line_separation' => true, |
56 | | - 'phpdoc_types_order' => [ |
57 | | - 'null_adjustment' => 'always_last', |
58 | | - 'sort_algorithm' => 'alpha', |
| 70 | + 'nullable_type_declaration_for_default_null_value' => true, |
| 71 | + 'ordered_class_elements' => ['order' => ['use_trait', 'case', 'constant', 'property']], |
| 72 | + 'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'], |
| 73 | + 'php_unit_construct' => ['assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame']], |
| 74 | + 'php_unit_mock_short_will_return' => true, |
| 75 | + 'php_unit_test_case_static_method_calls' => [ |
| 76 | + 'call_type' => 'self', |
| 77 | + 'methods' => [ |
| 78 | + 'any' => 'this', |
| 79 | + 'atLeast' => 'this', |
| 80 | + 'atLeastOnce' => 'this', |
| 81 | + 'atMost' => 'this', |
| 82 | + 'exactly' => 'this', |
| 83 | + 'never' => 'this', |
| 84 | + 'onConsecutiveCalls' => 'this', |
| 85 | + 'once' => 'this', |
| 86 | + 'returnArgument' => 'this', |
| 87 | + 'returnCallback' => 'this', |
| 88 | + 'returnSelf' => 'this', |
| 89 | + 'returnValue' => 'this', |
| 90 | + 'returnValueMap' => 'this', |
| 91 | + 'throwException' => 'this', |
| 92 | + ], |
59 | 93 | ], |
60 | | - 'phpdoc_var_annotation_correct_order' => true, |
61 | | - 'phpdoc_var_without_name' => true, |
62 | | - 'self_accessor' => true, |
| 94 | + 'phpdoc_no_access' => true, |
| 95 | + 'phpdoc_no_empty_return' => true, |
| 96 | + 'phpdoc_no_package' => true, |
| 97 | + 'phpdoc_scalar' => true, |
| 98 | + 'phpdoc_trim' => true, |
| 99 | + 'phpdoc_types' => true, |
| 100 | + 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], |
| 101 | + 'protected_to_private' => true, |
| 102 | + 'single_quote' => true, |
| 103 | + 'single_line_comment_style' => ['comment_types' => ['hash']], |
| 104 | + 'trailing_comma_in_multiline' => ['elements' => ['arrays']], |
| 105 | + 'whitespace_after_comma_in_array' => ['ensure_single_space' => true], |
| 106 | + 'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false], |
63 | 107 | ]) |
64 | 108 | ->getFinder() |
65 | 109 | ->exclude('templates') |
66 | 110 | ->exclude('tests/Unit/Fixtures') |
67 | 111 | ->in(__DIR__) |
68 | | - ->append(['typo3-coding-standards']) |
69 | | -; |
| 112 | + ->append(['typo3-coding-standards']); |
70 | 113 |
|
71 | 114 | return $config; |
0 commit comments