|
1 |
| -<?php |
| 1 | +<?php declare(strict_types=1); |
2 | 2 |
|
3 |
| -declare(strict_types=1); |
| 3 | +/* |
| 4 | + * This file is part of Biurad opensource projects. |
| 5 | + * |
| 6 | + * @copyright 2020 Biurad Group (https://biurad.com/) |
| 7 | + * @license https://opensource.org/licenses/BSD-3-Clause License |
| 8 | + * |
| 9 | + * For the full copyright and license information, please view the LICENSE |
| 10 | + * file that was distributed with this source code. |
| 11 | + */ |
4 | 12 |
|
5 | 13 | $header = <<<'EOF'
|
6 |
| -This file is part of BiuradPHP opensource projects. |
| 14 | +This file is part of Biurad opensource projects. |
7 | 15 |
|
8 |
| -PHP version 7.4 and above required |
9 |
| -
|
10 |
| -@author Divine Niiquaye Ibok <[email protected]> |
11 |
| -@copyright 2019 Biurad Group (https://biurad.com/) |
| 16 | +@copyright 2020 Biurad Group (https://biurad.com/) |
12 | 17 | @license https://opensource.org/licenses/BSD-3-Clause License
|
13 | 18 |
|
14 | 19 | For the full copyright and license information, please view the LICENSE
|
|
17 | 22 |
|
18 | 23 | return (new PhpCsFixer\Config())
|
19 | 24 | ->setRiskyAllowed(true)
|
20 |
| - ->setFinder((new PhpCsFixer\Finder())->append([__FILE__])) |
| 25 | + ->setFinder( |
| 26 | + (new PhpCsFixer\Finder()) |
| 27 | + ->in(__DIR__) |
| 28 | + ->append([__FILE__]) |
| 29 | + ->notPath('#/Fixtures/#') |
| 30 | + ->exclude([ |
| 31 | + 'vendor/', |
| 32 | + 'packages/*/vendor/', |
| 33 | + ]) |
| 34 | + ) |
21 | 35 | ->setRules([
|
22 |
| - '@PSR12' => true, |
23 |
| - //'DoctrineAnnotation' => true, |
24 |
| - 'header_comment' => ['header' => $header], |
25 |
| - 'general_phpdoc_tag_rename' => [ |
26 |
| - 'replacements' => [ |
27 |
| - 'inheritDocs' => 'inheritDoc', |
28 |
| - 'inheritDoc' => 'inheritdoc', |
29 |
| - ], |
30 |
| - ], |
31 |
| - 'backtick_to_shell_exec' => true, |
32 |
| - 'no_mixed_echo_print' => true, |
33 |
| - 'array_syntax' => ['syntax' => 'short'], |
34 |
| - 'no_multiline_whitespace_around_double_arrow' => true, |
35 |
| - 'no_trailing_comma_in_singleline_array' => true, |
36 |
| - 'no_whitespace_before_comma_in_array' => true, |
37 |
| - 'normalize_index_brace' => true, |
38 |
| - 'trailing_comma_in_multiline' => true, |
39 |
| - 'trim_array_spaces' => true, |
40 |
| - 'whitespace_after_comma_in_array' => true, |
41 |
| - 'native_function_type_declaration_casing' => true, |
42 |
| - 'braces' => [ |
43 |
| - 'allow_single_line_anonymous_class_with_empty_body' => true, |
44 |
| - 'allow_single_line_closure' => true, |
45 |
| - ], |
46 |
| - 'magic_constant_casing' => true, |
47 |
| - 'magic_method_casing' => true, |
48 |
| - 'native_function_casing' => true, |
49 |
| - 'cast_spaces' => true, |
50 |
| - 'no_short_bool_cast' => true, |
51 |
| - 'no_unset_cast' => true, |
52 |
| - 'short_scalar_cast' => true, |
53 |
| - 'class_attributes_separation' => true, |
| 36 | + '@Symfony' => true, |
| 37 | + '@Symfony:risky' => true, |
| 38 | + '@PHP80Migration:risky' => true, |
| 39 | + '@PHPUnit84Migration:risky' => true, |
54 | 40 | 'protected_to_private' => false,
|
55 |
| - 'no_empty_comment' => true, |
56 |
| - 'single_line_comment_style' => true, |
| 41 | + 'single_import_per_statement' => false, |
| 42 | + 'blank_line_after_opening_tag' => false, |
| 43 | + 'linebreak_after_opening_tag' => false, |
| 44 | + 'single_class_element_per_statement' => false, |
| 45 | + 'single_trait_insert_per_statement' => false, |
| 46 | + //'group_import' => true, |
57 | 47 | 'native_constant_invocation' => true,
|
58 |
| - 'include' => true, |
59 |
| - 'no_alternative_syntax' => true, |
60 |
| - 'no_superfluous_elseif' => true, |
61 |
| - 'no_trailing_comma_in_list_call' => true, |
62 |
| - 'no_unneeded_control_parentheses' => true, |
63 |
| - 'no_unneeded_curly_braces' => true, |
64 |
| - 'no_useless_else' => true, |
65 |
| - //'switch_continue_to_break' => true, |
66 |
| - 'yoda_style' => true, |
67 |
| - 'combine_nested_dirname' => true, |
68 |
| - 'function_typehint_space' => true, |
69 |
| - 'lambda_not_used_import' => true, |
| 48 | + 'comment_to_phpdoc' => true, |
| 49 | + 'strict_param' => true, |
| 50 | + 'no_unset_on_property' => true, |
| 51 | + 'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => false], |
| 52 | + 'ordered_imports' => ['imports_order' => ['class', 'const', 'function'], 'sort_algorithm' => 'alpha'], |
| 53 | + 'header_comment' => ['header' => $header], |
70 | 54 | 'native_function_invocation' => [
|
71 |
| - 'include' => ['@compiler_optimized', '@all'], |
72 |
| - 'scope' => 'namespaced', |
| 55 | + 'include' => ['@compiler_optimized', '@internal'], |
73 | 56 | 'strict' => true,
|
74 | 57 | ],
|
75 |
| - //'single_line_throw' => true, |
76 |
| - //'use_arrow_functions' => true, |
77 |
| - 'void_return' => true, |
78 |
| - //'global_namespace_import' => true, |
79 |
| - 'no_unused_imports' => true, |
80 |
| - 'single_import_per_statement' => false, |
81 |
| - 'combine_consecutive_issets' => true, |
82 |
| - 'combine_consecutive_unsets' => true, |
83 |
| - 'dir_constant' => true, |
84 |
| - 'function_to_constant' => true, |
85 |
| - 'is_null' => true, |
86 |
| - 'no_unset_on_property' => true, |
87 |
| - 'single_space_after_construct' => true, |
88 |
| - 'clean_namespace' => true, |
89 |
| - 'no_leading_namespace_whitespace' => true, |
90 |
| - 'binary_operator_spaces' => true, |
91 |
| - 'concat_space' => ['spacing' => 'one'], |
92 |
| - 'increment_style' => true, |
93 |
| - 'object_operator_without_whitespace' => true, |
94 |
| - 'standardize_increment' => true, |
95 |
| - 'standardize_not_equals' => true, |
96 |
| - 'ternary_to_null_coalescing' => true, |
97 |
| - 'unary_operator_spaces' => true, |
98 |
| - 'echo_tag_syntax' => true, |
99 |
| - 'linebreak_after_opening_tag' => true, |
100 |
| - 'align_multiline_comment' => true, |
101 |
| - 'no_blank_lines_after_phpdoc' => true, |
102 |
| - 'php_unit_construct' => true, |
103 |
| - 'php_unit_fqcn_annotation' => true, |
104 |
| - 'php_unit_method_casing' => true, |
105 |
| - '@PHPUnit84Migration:risky' => true, |
106 |
| - 'no_empty_phpdoc' => true, |
107 |
| - 'no_superfluous_phpdoc_tags' => [ |
108 |
| - 'allow_mixed' => true, |
109 |
| - 'allow_unused_params' => true, |
110 |
| - ], |
111 |
| - 'phpdoc_align' => true, |
112 |
| - 'phpdoc_annotation_without_dot' => true, |
113 |
| - 'phpdoc_indent' => true, |
114 |
| - 'phpdoc_inline_tag_normalizer' => true, |
115 |
| - 'phpdoc_no_access' => true, |
116 |
| - 'phpdoc_no_empty_return' => true, |
117 |
| - 'phpdoc_no_package' => true, |
118 |
| - 'phpdoc_no_useless_inheritdoc' => true, |
119 |
| - 'phpdoc_order' => true, |
120 |
| - 'phpdoc_return_self_reference' => true, |
121 |
| - 'phpdoc_scalar' => true, |
122 |
| - 'phpdoc_separation' => true, |
123 |
| - 'phpdoc_single_line_var_spacing' => true, |
124 |
| - 'phpdoc_summary' => true, |
125 |
| - 'phpdoc_tag_type' => [ |
126 |
| - 'tags' => [ |
127 |
| - 'inheritdoc' => 'inline', |
| 58 | + 'general_phpdoc_tag_rename' => [ |
| 59 | + 'replacements' => [ |
| 60 | + 'inheritDocs' => 'inheritdoc', |
| 61 | + 'inheritDoc' => 'inheritdoc', |
128 | 62 | ],
|
129 | 63 | ],
|
130 |
| - 'phpdoc_to_comment' => true, |
131 |
| - 'phpdoc_trim' => true, |
132 |
| - 'phpdoc_types' => true, |
133 |
| - 'phpdoc_trim_consecutive_blank_line_separation' => true, |
134 |
| - 'phpdoc_types_order' => [ |
135 |
| - 'null_adjustment' => 'always_last', |
136 |
| - 'sort_algorithm' => 'none', |
137 |
| - ], |
138 |
| - 'phpdoc_var_without_name' => true, |
139 |
| - 'return_assignment' => true, |
140 |
| - //'simplified_null_return' => true, |
141 |
| - //'no_empty_statement' => true, |
142 |
| - //'no_singleline_whitespace_before_semicolons' => true, |
143 |
| - 'semicolon_after_instruction' => true, |
144 |
| - 'space_after_semicolon' => [ |
145 |
| - 'remove_in_empty_for_expressions' => true, |
146 |
| - ], |
147 |
| - 'declare_strict_types' => true, |
148 |
| - 'single_quote' => true, |
149 |
| - 'array_indentation' => true, |
150 | 64 | 'blank_line_before_statement' => [
|
151 |
| - 'statements' => [ |
152 |
| - 'break', |
153 |
| - 'continue', |
154 |
| - 'declare', |
155 |
| - 'do', |
156 |
| - 'for', |
157 |
| - 'foreach', |
158 |
| - 'if', |
159 |
| - 'include', |
160 |
| - 'include_once', |
161 |
| - 'require', |
162 |
| - 'require_once', |
163 |
| - 'return', |
164 |
| - 'switch', |
165 |
| - 'throw', |
166 |
| - 'try', |
167 |
| - 'while', |
168 |
| - 'yield', |
169 |
| - ], |
| 65 | + 'statements' => [], |
170 | 66 | ],
|
171 |
| - 'no_extra_blank_lines' => true, |
172 |
| - 'no_spaces_around_offset' => true, |
173 |
| - 'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => false], |
174 |
| - |
175 |
| - // Risky standard |
176 |
| - //'@PSR12:risky' => true, |
177 |
| - //'group_import' => true, |
178 |
| - //'ordered_traits' => true, |
179 |
| - //'self_accessor' => true, |
180 |
| - //'array_push' => true, |
181 |
| - //'logical_operators' => true, |
182 |
| - //'set_type_to_cast' => true, |
183 |
| - //'modernize_types_casting' => true, |
184 |
| - //'no_null_property_initialization' => true, |
185 |
| - //'no_php4_constructor' => true, |
186 |
| - //'no_unneeded_final_method' => true, |
187 |
| - //'psr_autoloading' => true, |
188 |
| - //'non_printable_character' => ['use_escape_sequences_in_strings' => true] |
189 |
| - ]); |
| 67 | + ]) |
| 68 | +; |
0 commit comments