Skip to content

Commit c793ad3

Browse files
authored
Upgrade PHP-CS-Fixer to 3.x (#448)
1 parent c7b89ff commit c793ad3

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

Diff for: .gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.gitattributes export-ignore
33
/.github/ export-ignore
44
.gitignore export-ignore
5-
.php_cs.dist export-ignore
5+
.php-cs-fixer.dist.php export-ignore
66
/Makefile export-ignore
77
/phpstan-baseline.neon export-ignore
88
/phpstan.neon.dist export-ignore

Diff for: .github/workflows/static.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
run: composer bin php-cs-fixer update --no-interaction --no-progress
5656

5757
- name: Execute PHP CS Fixer
58-
run: vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run
58+
run: vendor/bin/php-cs-fixer fix --diff --dry-run
5959

6060
psalm:
6161
name: Psalm

Diff for: .gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
.php_cs
2-
.php_cs.cache
1+
.php-cs-fixer.php
2+
.php-cs-fixer.cache
33
.phpunit.result.cache
44
composer.lock
55
vendor/

Diff for: .php_cs.dist renamed to .php-cs-fixer.dist.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
<?php
22

3-
$config = PhpCsFixer\Config::create()
3+
$config = (new PhpCsFixer\Config())
44
->setRiskyAllowed(true)
55
->setRules([
66
'@PSR2' => true,
77
'array_syntax' => ['syntax' => 'short'],
88
'concat_space' => ['spacing' => 'one'],
99
'declare_strict_types' => true,
10-
'final_static_access' => true,
1110
'fully_qualified_strict_types' => true,
1211
'function_to_constant' => ['functions' => ['php_sapi_name']],
1312
'header_comment' => false,
14-
'is_null' => ['use_yoda_style' => true],
1513
'list_syntax' => ['syntax' => 'short'],
1614
'lowercase_cast' => true,
1715
'magic_method_casing' => true,
@@ -36,11 +34,11 @@
3634
'php_unit_mock' => ['target' => 'newest'],
3735
'php_unit_mock_short_will_return' => true,
3836
'php_unit_no_expectation_annotation' => ['target' => 'newest'],
39-
'php_unit_ordered_covers' => true,
4037
'php_unit_test_annotation' => ['style' => 'prefix'],
4138
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
4239
'phpdoc_align' => ['align' => 'vertical'],
4340
'phpdoc_no_useless_inheritdoc' => true,
41+
'phpdoc_order_by_value' => ['annotations' => ['covers']],
4442
'phpdoc_scalar' => true,
4543
'phpdoc_separation' => true,
4644
'phpdoc_single_line_var_spacing' => true,
@@ -49,11 +47,13 @@
4947
'phpdoc_types' => true,
5048
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
5149
'phpdoc_var_without_name' => true,
50+
'self_static_accessor' => true,
5251
'single_trait_insert_per_statement' => true,
5352
'standardize_not_equals' => true,
5453
'ternary_to_null_coalescing' => true,
5554
'visibility_required' => true,
5655
'void_return' => true,
56+
'yoda_style' => false,
5757
// 'native_function_invocation' => true,
5858
])
5959
->setFinder(

Diff for: tests/UriResolverTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
class UriResolverTest extends TestCase
1616
{
17-
const RFC3986_BASE = 'http://a/b/c/d;p?q';
17+
private const RFC3986_BASE = 'http://a/b/c/d;p?q';
1818

1919
/**
2020
* @dataProvider getResolveTestCases

Diff for: vendor-bin/php-cs-fixer/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
33
"php": "^7.2.5 || ^8.0",
4-
"friendsofphp/php-cs-fixer": "2.18.4"
4+
"friendsofphp/php-cs-fixer": "3.2.1"
55
},
66
"config": {
77
"preferred-install": "dist"

0 commit comments

Comments
 (0)