Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit 01aa62d

Browse files
Update tools
1 parent 5c84826 commit 01aa62d

11 files changed

+4731
-2667
lines changed

.gitattributes

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
/.github export-ignore
2-
/.phive export-ignore
3-
/.php_cs.dist export-ignore
4-
/build export-ignore
5-
/build.xml export-ignore
6-
/phpunit.xml export-ignore
7-
/tests export-ignore
8-
/tools export-ignore
9-
/tools/* binary
1+
/.github export-ignore
2+
/.phive export-ignore
3+
/.php-cs-fixer.dist.php export-ignore
4+
/build export-ignore
5+
/build.xml export-ignore
6+
/phpunit.xml export-ignore
7+
/tests export-ignore
8+
/tools export-ignore
9+
/tools/* binary
1010

1111
*.php diff=php

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/build/*.phar*
33
/.idea
44
/vendor
5-
/.php_cs
6-
/.php_cs.cache
5+
/.php-cs-fixer.php
6+
/.php-cs-fixer.cache
77
/.phpunit.cache
88
/composer.lock

.phive/phars.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="phpunit" version="^9.1" installed="9.4.2" location="./tools/phpunit" copy="true"/>
4-
<phar name="phpab" version="^1.25" installed="1.26.0" location="./tools/phpab" copy="true"/>
5-
<phar name="php-cs-fixer" version="^2.16" installed="2.16.7" location="./tools/php-cs-fixer" copy="true"/>
6-
<phar name="psalm" version="^3.11" installed="3.18.2" location="./tools/psalm" copy="true"/>
7-
<phar name="composer" version="^2.0.3" installed="2.0.3" location="./tools/composer" copy="true"/>
3+
<phar name="phpunit" version="^9.5" installed="9.5.4" location="./tools/phpunit" copy="true"/>
4+
<phar name="phpab" version="^1.26" installed="1.26.0" location="./tools/phpab" copy="true"/>
5+
<phar name="php-cs-fixer" version="^3.0" installed="3.0.0" location="./tools/php-cs-fixer" copy="true"/>
6+
<phar name="psalm" version="^4.0" installed="4.7.1" location="./tools/psalm" copy="true"/>
7+
<phar name="composer" version="^2.0" installed="2.0.13" location="./tools/composer" copy="true"/>
88
</phive>

.php_cs.dist .php-cs-fixer.dist.php

+76-7
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,21 @@
1313
->in(__DIR__ . '/src')
1414
->in(__DIR__ . '/tests/unit');
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',
2628
'=>' => 'align_single_space_minimal',
29+
// Workaround for https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/5495
30+
'|' => null,
2731
],
2832
],
2933
'blank_line_after_namespace' => true,
@@ -33,7 +37,6 @@
3337
'continue',
3438
'declare',
3539
'default',
36-
'die',
3740
'do',
3841
'exit',
3942
'for',
@@ -54,42 +57,62 @@
5457
],
5558
'braces' => true,
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' => 'one'
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,
@@ -99,10 +122,13 @@
99122
'native_function_type_declaration_casing' => true,
100123
'new_with_braces' => false,
101124
'no_alias_functions' => true,
125+
'no_alias_language_construct_call' => true,
102126
'no_alternative_syntax' => true,
127+
'no_binary_string' => true,
103128
'no_blank_lines_after_class_opening' => true,
104129
'no_blank_lines_after_phpdoc' => true,
105130
'no_blank_lines_before_namespace' => true,
131+
'no_break_comment' => true,
106132
'no_closing_tag' => true,
107133
'no_empty_comment' => true,
108134
'no_empty_phpdoc' => true,
@@ -116,7 +142,6 @@
116142
'no_null_property_initialization' => true,
117143
'no_php4_constructor' => true,
118144
'no_short_bool_cast' => true,
119-
'no_short_echo_tag' => true,
120145
'no_singleline_whitespace_before_semicolons' => true,
121146
'no_spaces_after_function_name' => true,
122147
'no_spaces_around_offset' => true,
@@ -129,19 +154,26 @@
129154
'no_trailing_comma_in_singleline_array' => true,
130155
'no_trailing_whitespace' => true,
131156
'no_trailing_whitespace_in_comment' => true,
157+
'no_trailing_whitespace_in_string' => true,
132158
'no_unneeded_control_parentheses' => true,
133159
'no_unneeded_curly_braces' => true,
134160
'no_unneeded_final_method' => true,
135161
'no_unreachable_default_argument_value' => true,
162+
'no_unset_cast' => true,
136163
'no_unset_on_property' => true,
137164
'no_unused_imports' => true,
138165
'no_useless_else' => true,
139166
'no_useless_return' => true,
167+
'no_useless_sprintf' => true,
140168
'no_whitespace_before_comma_in_array' => true,
141169
'no_whitespace_in_blank_line' => true,
142170
'non_printable_character' => true,
143171
'normalize_index_brace' => true,
144172
'object_operator_without_whitespace' => true,
173+
'operator_linebreak' => [
174+
'only_booleans' => true,
175+
'position' => 'end',
176+
],
145177
'ordered_class_elements' => [
146178
'order' => [
147179
'use_trait',
@@ -177,24 +209,43 @@
177209
'direction' => 'ascend',
178210
'order' => 'alpha',
179211
],
212+
'ordered_traits' => true,
213+
'php_unit_set_up_tear_down_visibility' => true,
214+
'php_unit_test_case_static_method_calls' => [
215+
'call_type' => 'this',
216+
],
180217
'phpdoc_add_missing_param_annotation' => false,
181218
'phpdoc_align' => true,
182219
'phpdoc_annotation_without_dot' => true,
183220
'phpdoc_indent' => true,
221+
'phpdoc_inline_tag_normalizer' => true,
184222
'phpdoc_no_access' => true,
223+
'phpdoc_no_alias_tag' => true,
185224
'phpdoc_no_empty_return' => true,
186225
'phpdoc_no_package' => true,
226+
'phpdoc_no_useless_inheritdoc' => true,
187227
'phpdoc_order' => true,
228+
'phpdoc_order_by_value' => [
229+
'annotations' => [
230+
'covers',
231+
'dataProvider',
232+
'throws',
233+
'uses',
234+
],
235+
],
188236
'phpdoc_return_self_reference' => true,
189237
'phpdoc_scalar' => true,
190238
'phpdoc_separation' => true,
191239
'phpdoc_single_line_var_spacing' => true,
192240
'phpdoc_summary' => true,
241+
'phpdoc_tag_casing' => true,
242+
'phpdoc_tag_type' => true,
193243
'phpdoc_to_comment' => true,
194244
'phpdoc_trim' => true,
195245
'phpdoc_trim_consecutive_blank_line_separation' => true,
196246
'phpdoc_types' => ['groups' => ['simple', 'meta']],
197247
'phpdoc_types_order' => true,
248+
'phpdoc_var_annotation_correct_order' => true,
198249
'phpdoc_var_without_name' => true,
199250
'pow_to_exponentiation' => true,
200251
'protected_to_private' => true,
@@ -208,13 +259,29 @@
208259
'simple_to_complex_string_variable' => true,
209260
'simplified_null_return' => false,
210261
'single_blank_line_at_eof' => true,
262+
'single_class_element_per_statement' => true,
211263
'single_import_per_statement' => true,
212264
'single_line_after_imports' => true,
213265
'single_quote' => true,
266+
'single_space_after_construct' => true,
267+
'single_trait_insert_per_statement' => true,
268+
'space_after_semicolon' => true,
269+
'standardize_increment' => true,
214270
'standardize_not_equals' => true,
271+
'static_lambda' => true,
215272
'strict_param' => true,
273+
'string_line_ending' => true,
274+
'switch_case_semicolon_to_colon' => true,
275+
'switch_case_space' => true,
276+
'switch_continue_to_break' => true,
277+
'ternary_operator_spaces' => true,
278+
'ternary_to_elvis_operator' => true,
216279
'ternary_to_null_coalescing' => true,
217-
'trailing_comma_in_multiline_array' => true,
280+
'trailing_comma_in_multiline' => [
281+
'elements' => [
282+
'arrays'
283+
]
284+
],
218285
'trim_array_spaces' => true,
219286
'unary_operator_spaces' => true,
220287
'visibility_required' => [
@@ -227,3 +294,5 @@
227294
'void_return' => true,
228295
'whitespace_after_comma_in_array' => true,
229296
]);
297+
298+
return $config;

.psalm/baseline.xml

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="3.18.2@19aa905f7c3c7350569999a93c40ae91ae4e1626">
2+
<files psalm-version="4.x-dev@">
33
<file src="src/CLI/Arguments.php">
44
<MixedPropertyTypeCoercion occurrences="3">
55
<code>$directories</code>
@@ -48,16 +48,24 @@
4848
</MixedAssignment>
4949
</file>
5050
<file src="src/Detector/Strategy/DefaultStrategy.php">
51-
<MixedArgument occurrences="1">
51+
<MixedArgument occurrences="2">
52+
<code>$lastToken + 1 - $firstToken</code>
5253
<code>$lastToken + 1 - $firstToken</code>
5354
</MixedArgument>
54-
<MixedArrayOffset occurrences="1">
55+
<MixedArrayOffset occurrences="2">
56+
<code>$this-&gt;hashes[$firstHash]</code>
5557
<code>$this-&gt;hashes[$firstHash]</code>
5658
</MixedArrayOffset>
57-
<PossiblyUndefinedVariable occurrences="4">
59+
<MixedOperand occurrences="2">
60+
<code>$firstToken</code>
61+
<code>$firstToken</code>
62+
</MixedOperand>
63+
<PossiblyUndefinedVariable occurrences="6">
5864
<code>$firstHash</code>
5965
<code>$firstHash</code>
6066
<code>$firstHash</code>
67+
<code>$firstHash</code>
68+
<code>$firstToken</code>
6169
<code>$firstToken</code>
6270
</PossiblyUndefinedVariable>
6371
</file>

.psalm/config.xml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
xmlns="https://getpsalm.org/schema/config"
55
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
66
errorBaseline=".psalm/baseline.xml"
7+
resolveFromConfigFile="false"
78
totallyTyped="true"
89
>
910
<projectFiles>

phpunit.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
44
bootstrap="vendor/autoload.php"
55
cacheResultFile=".phpunit.cache/test-results"
66
executionOrder="depends,defects"
77
forceCoversAnnotation="true"
88
beStrictAboutCoversAnnotation="true"
99
beStrictAboutOutputDuringTests="true"
10-
beStrictAboutTodoAnnotatedTests="true"
1110
failOnRisky="true"
1211
failOnWarning="true"
1312
colors="true"
1413
verbose="true">
1514
<testsuites>
1615
<testsuite name="default">
17-
<directory suffix="Test.php">tests</directory>
16+
<directory>tests</directory>
1817
</testsuite>
1918
</testsuites>
2019

tools/composer

37.9 KB
Binary file not shown.

tools/php-cs-fixer

265 KB
Binary file not shown.

0 commit comments

Comments
 (0)