Skip to content

Commit afb2c23

Browse files
committed
ci: upgrade php-cs-fixer to next major release
1 parent 94cc727 commit afb2c23

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/vendor
33
.env
44
.phpunit.result.cache
5-
.php_cs.cache
5+
.php-cs-fixer.cache

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

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@
99
file that was distributed with this source code.
1010
EOF;
1111

12-
return PhpCsFixer\Config::create()
12+
$finder = PhpCsFixer\Finder::create()
13+
->in([
14+
__DIR__ . '/src',
15+
__DIR__ . '/tests',
16+
])
17+
;
18+
19+
$config = new PhpCsFixer\Config();
20+
$config
1321
->setRiskyAllowed(true)
1422
->setRules([
15-
'@PHP56Migration' => true,
1623
'@Symfony' => true,
1724
'@Symfony:risky' => true,
1825
'align_multiline_comment' => true,
@@ -26,13 +33,12 @@
2633
'header_comment' => ['header' => $header],
2734
'heredoc_to_nowdoc' => true,
2835
'list_syntax' => ['syntax' => 'long'],
29-
'method_argument_space' => ['ensure_fully_multiline' => true],
3036
'method_chaining_indentation' => false,
3137
'native_function_invocation' => false,
3238
'native_constant_invocation' => false,
33-
'no_extra_consecutive_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']],
39+
'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']],
3440
'no_null_property_initialization' => true,
35-
'no_short_echo_tag' => true,
41+
'echo_tag_syntax' => ['format' => 'long'],
3642
'no_superfluous_phpdoc_tags' => ['allow_mixed' => false],
3743
'no_unneeded_curly_braces' => true,
3844
'no_unneeded_final_method' => true,
@@ -61,7 +67,7 @@
6167
'method_protected_abstract',
6268
'method_private',
6369
],
64-
'sortAlgorithm' => 'alpha'
70+
'sort_algorithm' => 'alpha'
6571
],
6672
'ordered_imports' => true,
6773
'php_unit_construct' => true,
@@ -72,14 +78,9 @@
7278
'phpdoc_types_order' => ['null_adjustment' => 'always_last'],
7379
'semicolon_after_instruction' => true,
7480
'single_line_comment_style' => true,
75-
'visibility_required' => ['const', 'property', 'method'],
7681
'yoda_style' => true,
7782
])
78-
->setFinder(
79-
PhpCsFixer\Finder::create()
80-
->in([
81-
__DIR__ . '/src',
82-
__DIR__ . '/tests',
83-
])
84-
)
83+
->setFinder($finder)
8584
;
85+
86+
return $config;

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"dg/bypass-finals": "^1.2",
2121
"dms/phpunit-arraysubset-asserts": "^0.1 || ^0.2",
2222
"fakerphp/faker": "^1.12",
23-
"friendsofphp/php-cs-fixer": "^2.16",
23+
"friendsofphp/php-cs-fixer": "^3.0",
2424
"php-mock/php-mock-phpunit": "^2.6",
2525
"php-parallel-lint/php-parallel-lint": "^1.2",
2626
"phpmd/phpmd": "^2.8",

grumphp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ grumphp:
2525
- 'src/Attachment/GDImageEditor.php'
2626
phpcsfixer2:
2727
allow_risky: true
28-
config: '.php_cs'
28+
config: '.php-cs-fixer.dist.php'
2929
phplint: ~
3030
phpmd:
3131
ruleset: ['phpmd.xml']

0 commit comments

Comments
 (0)