Skip to content

Commit 781de01

Browse files
Update tools
1 parent c019dae commit 781de01

File tree

9 files changed

+106
-140
lines changed

9 files changed

+106
-140
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/build/phar
22
/build/*.phar*
33
/.idea
4-
/.php_cs
5-
/.php_cs.cache
4+
/.php-cs-fixer.php
5+
/.php-cs-fixer.cache
66
/.phpunit.cache
77
/composer.lock
88
/vendor

.phive/phars.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="php-cs-fixer" version="^2.16.4" installed="2.16.7" location="./tools/php-cs-fixer" copy="true"/>
4-
<phar name="psalm" version="^3.13.1" installed="3.18.2" location="./tools/psalm" copy="true"/>
5-
<phar name="composer" version="^2.0.3" installed="2.0.3" location="./tools/composer" copy="true"/>
3+
<phar name="php-cs-fixer" version="^3.0" installed="3.8.0" location="./tools/php-cs-fixer" copy="true"/>
4+
<phar name="psalm" version="^4.0" installed="4.22.0" location="./tools/psalm" copy="true"/>
5+
<phar name="composer" version="^2.0.3" installed="2.3.0-RC2" location="./tools/composer" copy="true"/>
66
</phive>

.php_cs.dist renamed to .php-cs-fixer.dist.php

Lines changed: 84 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313
->in(__DIR__ . '/src')
1414
->in(__DIR__ . '/tests');
1515

16-
return PhpCsFixer\Config::create()
17-
->setFinder($finder)
16+
$config = new PhpCsFixer\Config;
17+
$config->setFinder($finder)
1818
->setRiskyAllowed(true)
1919
->setRules([
2020
'align_multiline_comment' => true,
2121
'array_indentation' => true,
22+
'array_push' => true,
2223
'array_syntax' => ['syntax' => 'short'],
24+
'backtick_to_shell_exec' => true,
2325
'binary_operator_spaces' => [
2426
'operators' => [
2527
'=' => 'align_single_space_minimal',
@@ -33,7 +35,6 @@
3335
'continue',
3436
'declare',
3537
'default',
36-
'die',
3738
'do',
3839
'exit',
3940
'for',
@@ -52,57 +53,85 @@
5253
'yield',
5354
],
5455
],
55-
'braces' => true,
56+
'braces' => [
57+
'position_after_anonymous_constructs' => 'next',
58+
],
5659
'cast_spaces' => true,
57-
'class_attributes_separation' => ['elements' => ['const', 'method', 'property']],
60+
'class_attributes_separation' => [
61+
'elements' => [
62+
'const' => 'one',
63+
'method' => 'one',
64+
'property' => 'only_if_meta'
65+
]
66+
],
67+
'class_definition' => true,
68+
'clean_namespace' => true,
5869
'combine_consecutive_issets' => true,
5970
'combine_consecutive_unsets' => true,
71+
'combine_nested_dirname' => true,
6072
'compact_nullable_typehint' => true,
6173
'concat_space' => ['spacing' => 'one'],
6274
'constant_case' => true,
6375
'declare_equal_normalize' => ['space' => 'none'],
6476
'declare_strict_types' => true,
6577
'dir_constant' => true,
78+
'echo_tag_syntax' => true,
6679
'elseif' => true,
6780
'encoding' => true,
81+
'ereg_to_preg' => true,
6882
'explicit_indirect_variable' => true,
6983
'explicit_string_variable' => true,
84+
'fopen_flag_order' => true,
7085
'full_opening_tag' => true,
7186
'fully_qualified_strict_types' => true,
7287
'function_declaration' => true,
88+
'function_to_constant' => true,
89+
'function_typehint_space' => true,
7390
'global_namespace_import' => [
7491
'import_classes' => true,
7592
'import_constants' => true,
7693
'import_functions' => true,
7794
],
7895
'header_comment' => ['header' => $header, 'separate' => 'none'],
7996
'heredoc_to_nowdoc' => true,
97+
'implode_call' => true,
98+
'include' => true,
8099
'increment_style' => [
81100
'style' => PhpCsFixer\Fixer\Operator\IncrementStyleFixer::STYLE_POST,
82101
],
83102
'indentation_type' => true,
84103
'is_null' => true,
104+
'lambda_not_used_import' => true,
85105
'line_ending' => true,
86106
'list_syntax' => ['syntax' => 'short'],
87107
'logical_operators' => true,
108+
'lowercase_cast' => true,
88109
'lowercase_keywords' => true,
89110
'lowercase_static_reference' => true,
90111
'magic_constant_casing' => true,
91112
'magic_method_casing' => true,
92-
'method_argument_space' => ['ensure_fully_multiline' => true],
113+
'method_argument_space' => [
114+
'on_multiline' => 'ensure_fully_multiline',
115+
],
93116
'modernize_types_casting' => true,
94117
'multiline_comment_opening_closing' => true,
95118
'multiline_whitespace_before_semicolons' => true,
96119
'native_constant_invocation' => false,
97120
'native_function_casing' => false,
98121
'native_function_invocation' => false,
99122
'native_function_type_declaration_casing' => true,
100-
'new_with_braces' => false,
123+
'new_with_braces' => [
124+
'named_class' => false,
125+
'anonymous_class' => false,
126+
],
101127
'no_alias_functions' => true,
128+
'no_alias_language_construct_call' => true,
102129
'no_alternative_syntax' => true,
130+
'no_binary_string' => true,
103131
'no_blank_lines_after_class_opening' => true,
104132
'no_blank_lines_after_phpdoc' => true,
105133
'no_blank_lines_before_namespace' => true,
134+
'no_break_comment' => true,
106135
'no_closing_tag' => true,
107136
'no_empty_comment' => true,
108137
'no_empty_phpdoc' => true,
@@ -116,7 +145,6 @@
116145
'no_null_property_initialization' => true,
117146
'no_php4_constructor' => true,
118147
'no_short_bool_cast' => true,
119-
'no_short_echo_tag' => true,
120148
'no_singleline_whitespace_before_semicolons' => true,
121149
'no_spaces_after_function_name' => true,
122150
'no_spaces_around_offset' => true,
@@ -129,19 +157,26 @@
129157
'no_trailing_comma_in_singleline_array' => true,
130158
'no_trailing_whitespace' => true,
131159
'no_trailing_whitespace_in_comment' => true,
160+
'no_trailing_whitespace_in_string' => true,
132161
'no_unneeded_control_parentheses' => true,
133162
'no_unneeded_curly_braces' => true,
134163
'no_unneeded_final_method' => true,
135164
'no_unreachable_default_argument_value' => true,
165+
'no_unset_cast' => true,
136166
'no_unset_on_property' => true,
137167
'no_unused_imports' => true,
138168
'no_useless_else' => true,
139169
'no_useless_return' => true,
170+
'no_useless_sprintf' => true,
140171
'no_whitespace_before_comma_in_array' => true,
141172
'no_whitespace_in_blank_line' => true,
142173
'non_printable_character' => true,
143174
'normalize_index_brace' => true,
144175
'object_operator_without_whitespace' => true,
176+
'operator_linebreak' => [
177+
'only_booleans' => true,
178+
'position' => 'end',
179+
],
145180
'ordered_class_elements' => [
146181
'order' => [
147182
'use_trait',
@@ -177,24 +212,43 @@
177212
'direction' => 'ascend',
178213
'order' => 'alpha',
179214
],
215+
'ordered_traits' => true,
216+
'php_unit_set_up_tear_down_visibility' => true,
217+
'php_unit_test_case_static_method_calls' => [
218+
'call_type' => 'this',
219+
],
180220
'phpdoc_add_missing_param_annotation' => false,
181221
'phpdoc_align' => true,
182222
'phpdoc_annotation_without_dot' => true,
183223
'phpdoc_indent' => true,
224+
'phpdoc_inline_tag_normalizer' => true,
184225
'phpdoc_no_access' => true,
226+
'phpdoc_no_alias_tag' => true,
185227
'phpdoc_no_empty_return' => true,
186228
'phpdoc_no_package' => true,
229+
'phpdoc_no_useless_inheritdoc' => true,
187230
'phpdoc_order' => true,
231+
'phpdoc_order_by_value' => [
232+
'annotations' => [
233+
'covers',
234+
'dataProvider',
235+
'throws',
236+
'uses',
237+
],
238+
],
188239
'phpdoc_return_self_reference' => true,
189240
'phpdoc_scalar' => true,
190241
'phpdoc_separation' => true,
191242
'phpdoc_single_line_var_spacing' => true,
192243
'phpdoc_summary' => true,
244+
'phpdoc_tag_casing' => true,
245+
'phpdoc_tag_type' => true,
193246
'phpdoc_to_comment' => true,
194247
'phpdoc_trim' => true,
195248
'phpdoc_trim_consecutive_blank_line_separation' => true,
196249
'phpdoc_types' => ['groups' => ['simple', 'meta']],
197250
'phpdoc_types_order' => true,
251+
'phpdoc_var_annotation_correct_order' => true,
198252
'phpdoc_var_without_name' => true,
199253
'pow_to_exponentiation' => true,
200254
'protected_to_private' => true,
@@ -208,14 +262,33 @@
208262
'simple_to_complex_string_variable' => true,
209263
'simplified_null_return' => false,
210264
'single_blank_line_at_eof' => true,
265+
'single_class_element_per_statement' => true,
211266
'single_import_per_statement' => true,
212267
'single_line_after_imports' => true,
213268
'single_quote' => true,
269+
'single_space_after_construct' => true,
270+
'single_trait_insert_per_statement' => true,
271+
'space_after_semicolon' => true,
272+
'standardize_increment' => true,
214273
'standardize_not_equals' => true,
274+
'static_lambda' => true,
215275
'strict_param' => true,
276+
'string_line_ending' => true,
277+
'switch_case_semicolon_to_colon' => true,
278+
'switch_case_space' => true,
279+
'switch_continue_to_break' => true,
280+
'ternary_operator_spaces' => true,
281+
'ternary_to_elvis_operator' => true,
216282
'ternary_to_null_coalescing' => true,
217-
'trailing_comma_in_multiline_array' => true,
283+
'trailing_comma_in_multiline' => [
284+
'elements' => [
285+
'arrays'
286+
]
287+
],
218288
'trim_array_spaces' => true,
289+
'types_spaces' => [
290+
'space' => 'none',
291+
],
219292
'unary_operator_spaces' => true,
220293
'visibility_required' => [
221294
'elements' => [
@@ -227,3 +300,5 @@
227300
'void_return' => true,
228301
'whitespace_after_comma_in_array' => true,
229302
]);
303+
304+
return $config;

0 commit comments

Comments
 (0)