Skip to content

Commit 227e6b1

Browse files
committed
Fix PHP-CS-Fixer
1 parent a5e21c6 commit 227e6b1

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

.php_cs.dist

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,31 @@ $finder = PhpCsFixer\Finder::create()
1313
->in(__DIR__)
1414
;
1515

16+
$rules = [
17+
'@PHP56Migration' => true,
18+
'@PHP56Migration:risky' => true,
19+
'@PHP71Migration' => true,
20+
'@PHP71Migration:risky' => true,
21+
];
22+
23+
if (\PHP_VERSION_ID >= 70300) {
24+
$rules = array_merge($rules, [
25+
'@PHP73Migration' => true,
26+
]);
27+
}
28+
if (\PHP_VERSION_ID >= 70400) {
29+
$rules = array_merge($rules, [
30+
'@PHP74Migration' => true,
31+
'@PHP74Migration:risky' => true,
32+
]);
33+
}
34+
1635
return PhpCsFixer\Config::create()
1736
->setRiskyAllowed(true)
1837
->setRules([
1938
'@Symfony' => true,
2039
'@Symfony:risky' => true,
2140
'@DoctrineAnnotation' => true,
22-
'@PHP56Migration' => true,
23-
'@PHP56Migration:risky' => true,
24-
'@PHP71Migration' => true,
25-
'@PHP71Migration:risky' => true,
26-
'@PHP73Migration' => true,
2741
'array_syntax' => ['syntax' => 'short'],
2842
'fopen_flags' => true,
2943
'header_comment' => ['header' => $fileHeaderComment, 'separate' => 'both'],

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"php": "^7.2"
2626
},
2727
"require-dev": {
28-
"friendsofphp/php-cs-fixer": "^2.13",
28+
"friendsofphp/php-cs-fixer": "^2.17.1",
2929
"phpunit/phpunit": "^8.0"
3030
},
3131
"config": {

0 commit comments

Comments
 (0)