Skip to content

Commit 512ca64

Browse files
committed
Fix PHP-CS-Fixer deprecation warnings
Fix the following warnings: ``` 15.95 > php-cs-fixer fix --diff --verbose '--dry-run' 16.10 You are running PHP CS Fixer v2, which is not maintained anymore. Please update to v3. 16.10 You may find an UPGRADE guide at https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v3.3.0/UPGRADE-v3.md . 16.10 If you need help while solving warnings, ask at https://gitter.im/PHP-CS-Fixer, we will help you! 16.10 16.10 PHP CS Fixer 2.19.3 Testament by Fabien Potencier and Dariusz Ruminski 16.10 Runtime: PHP 7.4.30 16.10 Loaded config default from "/opt/composer/v1/.php_cs". 16.14 ...... 16.26 Legend: ?-unknown, I-invalid file syntax (file ignored), S-skipped (cached or empty file), .-no changes, F-fixed, E-error 16.26 16.26 Checked all files in 0.134 seconds, 14.000 MB memory used 16.26 16.26 Detected deprecations in use: 16.26 - Option "ensure_fully_multiline" for rule "method_argument_space" is deprecated and will be removed in version 3.0. Use option "on_multiline" instead. 16.26 - Option "use_yoda_style" for rule "is_null" is deprecated and will be removed in version 3.0. Use "yoda_style" fixer instead. 16.26 - PhpCsFixer\Config::create is deprecated since 2.17 and will be removed in 3.0, use the constructor instead. 16.26 - Rule "no_multiline_whitespace_before_semicolons" is deprecated. Use "multiline_whitespace_before_semicolons" instead. ``` Originally I tried bumping `php-cs-fixer` to `v3` as suggested. But in dependabot#5694 I realized that was impossible given that `composer/composer` `v1` depended `composer/semver` `^v1` but `php-cs-fixer` `v3` requires `composer/semver` `v3`... So for now just fix some old deprecation warnings and move on. At least I got what I really wanted from this, which was to learn how Composer works.
1 parent 46ed304 commit 512ca64

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

composer/helpers/v1/.php-cs-fixer.dist.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
$finder = PhpCsFixer\Finder::create()
33
->in(__DIR__ . '/src')
44
->in(__DIR__ . '/bin');
5-
return PhpCsFixer\Config::create()
5+
$config = new PhpCsFixer\Config();
6+
return $config
67
->setRules([
78
'@Symfony' => true,
89
'array_syntax' => ['syntax' => 'short'],
910
'blank_line_after_opening_tag' => true,
1011
'concat_space' => ['spacing' => 'one'],
1112
'declare_strict_types' => true,
1213
'increment_style' => ['style' => 'post'],
13-
'is_null' => ['use_yoda_style' => false],
1414
'list_syntax' => ['syntax' => 'short'],
15-
'method_argument_space' => ['ensure_fully_multiline' => true],
15+
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
1616
'modernize_types_casting' => true,
17-
'no_multiline_whitespace_before_semicolons' => true,
17+
'multiline_whitespace_before_semicolons' => true,
1818
'no_useless_else' => true,
1919
'no_useless_return' => true,
2020
'ordered_imports' => true,

0 commit comments

Comments
 (0)