Skip to content

Commit

Permalink
Update cs-fixer to 3.x (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
marmichalski authored Sep 30, 2021
1 parent 2a3f740 commit 1dc56b6
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 146 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/vendor
/.php_cs.cache
/.php-cs-fixer.cache
/.phpunit.result.cache
/phpunit.xml
15 changes: 11 additions & 4 deletions .php_cs → .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
->in(__DIR__.DIRECTORY_SEPARATOR.'src')
;

return PhpCsFixer\Config::create()
$config = new PhpCsFixer\Config();

return $config
->setRiskyAllowed(true)
->setRules([
'@PHP71Migration' => true,
Expand All @@ -16,11 +18,16 @@
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => [
'importsOrder' => null,
'sortAlgorithm' => 'alpha',
'imports_order' => null,
'sort_algorithm' => 'alpha',
],
'phpdoc_order' => true,
'yoda_style' => null,
'yoda_style' => [
'equal' => null,
'identical' => null,
'less_and_greater' => null,
'always_move_variable' => false,
],
// risky -->
'strict_param' => true,
])
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"phpstan/phpstan": "^0.12.91"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.18",
"friendsofphp/php-cs-fixer": "^3.1",
"phpunit/phpunit": "^8.0",
"yiisoft/yii2": "^2.0.42",
"phpstan/phpstan-phpunit": "^0.12"
Expand Down
Loading

0 comments on commit 1dc56b6

Please sign in to comment.