|
40 | 40 | ->exclude('var') |
41 | 41 | ) |
42 | 42 | ->setRules([ |
43 | | - '@PSR2' => true, |
44 | | - 'header_comment' => [ |
45 | | - 'header' => $header, |
| 43 | + '@DoctrineAnnotation' => true, |
| 44 | + // @todo: Switch to @PER-CS2x0 once php-cs-fixer's todo list is |
| 45 | + // done: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/7247 |
| 46 | + '@PER-CS1x0' => true, |
| 47 | + 'array_indentation' => true, |
| 48 | + 'array_syntax' => ['syntax' => 'short'], |
| 49 | + 'cast_spaces' => ['space' => 'none'], |
| 50 | + // @todo: Can be dropped once we enable @PER-CS2x0 |
| 51 | + 'concat_space' => ['spacing' => 'one'], |
| 52 | + 'declare_equal_normalize' => ['space' => 'none'], |
| 53 | + 'declare_parentheses' => true, |
| 54 | + 'dir_constant' => true, |
| 55 | + // @todo: Can be dropped once we enable @PER-CS2x0 |
| 56 | + 'function_declaration' => [ |
| 57 | + 'closure_fn_spacing' => 'none', |
46 | 58 | ], |
47 | | - 'general_phpdoc_annotation_remove' => [ |
48 | | - 'annotations' => [ |
49 | | - 'author', |
50 | | - ], |
| 59 | + 'function_to_constant' => [ |
| 60 | + 'functions' => [ |
| 61 | + 'get_called_class', |
| 62 | + 'get_class', |
| 63 | + 'get_class_this', |
| 64 | + 'php_sapi_name', |
| 65 | + 'phpversion', |
| 66 | + 'pi', |
| 67 | + ] |
51 | 68 | ], |
52 | | - 'no_leading_import_slash' => true, |
53 | | - 'no_trailing_comma_in_singleline' => true, |
54 | | - 'no_singleline_whitespace_before_semicolons' => true, |
55 | | - 'no_unused_imports' => true, |
56 | | - 'concat_space' => ['spacing' => 'one'], |
57 | | - 'no_whitespace_in_blank_line' => true, |
58 | | - 'ordered_imports' => true, |
59 | | - 'single_quote' => true, |
60 | | - 'no_empty_statement' => true, |
61 | | - 'no_extra_blank_lines' => true, |
62 | | - 'phpdoc_no_package' => true, |
63 | | - 'phpdoc_scalar' => true, |
64 | | - 'no_blank_lines_after_phpdoc' => true, |
65 | | - 'array_syntax' => ['syntax' => 'short'], |
66 | | - 'whitespace_after_comma_in_array' => true, |
67 | 69 | 'type_declaration_spaces' => true, |
68 | | - 'single_line_comment_style' => true, |
| 70 | + 'global_namespace_import' => [ |
| 71 | + 'import_classes' => false, |
| 72 | + 'import_constants' => false, |
| 73 | + 'import_functions' => false, |
| 74 | + ], |
| 75 | + 'list_syntax' => ['syntax' => 'short'], |
| 76 | + // @todo: Can be dropped once we enable @PER-CS2x0 |
| 77 | + 'method_argument_space' => true, |
| 78 | + 'modernize_strpos' => true, |
| 79 | + 'modernize_types_casting' => true, |
| 80 | + 'native_function_casing' => true, |
69 | 81 | 'no_alias_functions' => true, |
70 | | - 'lowercase_cast' => true, |
| 82 | + 'no_blank_lines_after_phpdoc' => true, |
| 83 | + 'no_empty_phpdoc' => true, |
| 84 | + 'no_empty_statement' => true, |
| 85 | + 'no_extra_blank_lines' => true, |
71 | 86 | 'no_leading_namespace_whitespace' => true, |
72 | | - 'native_function_casing' => true, |
73 | | - 'self_accessor' => true, |
| 87 | + 'no_null_property_initialization' => true, |
74 | 88 | 'no_short_bool_cast' => true, |
| 89 | + 'no_singleline_whitespace_before_semicolons' => true, |
| 90 | + 'no_superfluous_elseif' => true, |
| 91 | + 'no_trailing_comma_in_singleline' => true, |
75 | 92 | 'no_unneeded_control_parentheses' => true, |
76 | | - 'trailing_comma_in_multiline' => [ |
77 | | - 'elements' => [ |
78 | | - 'arrays', |
| 93 | + 'no_unused_imports' => true, |
| 94 | + 'no_useless_else' => true, |
| 95 | + 'no_useless_nullsafe_operator' => true, |
| 96 | + 'nullable_type_declaration' => [ |
| 97 | + 'syntax' => 'question_mark', |
| 98 | + ], |
| 99 | + 'nullable_type_declaration_for_default_null_value' => true, |
| 100 | + 'ordered_class_elements' => ['order' => ['use_trait', 'case', 'constant', 'property']], |
| 101 | + 'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'], |
| 102 | + 'php_unit_construct' => ['assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame']], |
| 103 | + 'php_unit_mock_short_will_return' => true, |
| 104 | + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self', |
| 105 | + 'methods' => [ |
| 106 | + 'any' => 'this', |
| 107 | + 'atLeast' => 'this', |
| 108 | + 'atLeastOnce' => 'this', |
| 109 | + 'atMost' => 'this', |
| 110 | + 'exactly' => 'this', |
| 111 | + 'never' => 'this', |
| 112 | + 'onConsecutiveCalls' => 'this', |
| 113 | + 'once' => 'this', |
| 114 | + 'returnArgument' => 'this', |
| 115 | + 'returnCallback' => 'this', |
| 116 | + 'returnSelf' => 'this', |
| 117 | + 'returnValue' => 'this', |
| 118 | + 'returnValueMap' => 'this', |
| 119 | + 'throwException' => 'this', |
79 | 120 | ], |
80 | 121 | ], |
| 122 | + 'phpdoc_no_access' => true, |
| 123 | + 'phpdoc_no_empty_return' => true, |
| 124 | + 'phpdoc_no_package' => true, |
| 125 | + 'phpdoc_scalar' => true, |
| 126 | + 'phpdoc_trim' => true, |
| 127 | + 'phpdoc_types' => true, |
| 128 | + 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], |
| 129 | + 'protected_to_private' => true, |
| 130 | + 'return_type_declaration' => ['space_before' => 'none'], |
| 131 | + 'single_quote' => true, |
| 132 | + 'single_space_around_construct' => true, |
| 133 | + 'single_line_comment_style' => ['comment_types' => ['hash']], |
| 134 | + // @todo: Can be dropped once we enable @PER-CS2x0 |
| 135 | + 'single_line_empty_body' => true, |
| 136 | + 'trailing_comma_in_multiline' => ['elements' => ['arrays']], |
| 137 | + 'whitespace_after_comma_in_array' => ['ensure_single_space' => true], |
| 138 | + 'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false], |
81 | 139 | ]); |
0 commit comments