Skip to content

Commit 1dc56b6

Browse files
authored
Update cs-fixer to 3.x (#46)
1 parent 2a3f740 commit 1dc56b6

File tree

4 files changed

+141
-146
lines changed

4 files changed

+141
-146
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/vendor
2-
/.php_cs.cache
2+
/.php-cs-fixer.cache
33
/.phpunit.result.cache
44
/phpunit.xml

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

+11-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
->in(__DIR__.DIRECTORY_SEPARATOR.'src')
55
;
66

7-
return PhpCsFixer\Config::create()
7+
$config = new PhpCsFixer\Config();
8+
9+
return $config
810
->setRiskyAllowed(true)
911
->setRules([
1012
'@PHP71Migration' => true,
@@ -16,11 +18,16 @@
1618
'no_useless_else' => true,
1719
'no_useless_return' => true,
1820
'ordered_imports' => [
19-
'importsOrder' => null,
20-
'sortAlgorithm' => 'alpha',
21+
'imports_order' => null,
22+
'sort_algorithm' => 'alpha',
2123
],
2224
'phpdoc_order' => true,
23-
'yoda_style' => null,
25+
'yoda_style' => [
26+
'equal' => null,
27+
'identical' => null,
28+
'less_and_greater' => null,
29+
'always_move_variable' => false,
30+
],
2431
// risky -->
2532
'strict_param' => true,
2633
])

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"phpstan/phpstan": "^0.12.91"
2020
},
2121
"require-dev": {
22-
"friendsofphp/php-cs-fixer": "^2.18",
22+
"friendsofphp/php-cs-fixer": "^3.1",
2323
"phpunit/phpunit": "^8.0",
2424
"yiisoft/yii2": "^2.0.42",
2525
"phpstan/phpstan-phpunit": "^0.12"

0 commit comments

Comments
 (0)