diff --git a/.gitignore b/.gitignore index cf6a7c3..51dc07c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /vendor/ .phpunit.cache phpunit.xml -.php_cs.cache +.php-cs-fixer.cache +.php-cs-fixer.php composer.lock diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 85% rename from .php_cs.dist rename to .php-cs-fixer.dist.php index fdce78e..8cecea8 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.dist.php @@ -5,7 +5,7 @@ ->in(__DIR__.'/tests') ; -return PhpCsFixer\Config::create() +return (new PhpCsFixer\Config()) ->setRiskyAllowed(true) ->setRules([ '@PHP71Migration' => true, @@ -19,18 +19,18 @@ 'no_unused_imports' => true, 'declare_strict_types' => true, 'ordered_imports' => [ - 'importsOrder' => null, - 'sortAlgorithm' => 'alpha', + 'imports_order' => null, + 'sort_algorithm' => 'alpha', ], 'phpdoc_order' => true, 'phpdoc_align' => true, 'phpdoc_no_access' => true, 'phpdoc_separation' => true, - 'pre_increment' => true, + 'increment_style' => ['style' => 'pre'], 'single_quote' => true, 'trim_array_spaces' => true, 'single_blank_line_before_namespace' => true, - 'yoda_style' => null, + 'yoda_style' => false, 'global_namespace_import' => [ 'import_classes' => false, 'import_constants' => false, diff --git a/composer.json b/composer.json index 861a91b..cb37fbc 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "php": ">=7.4" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.18", + "friendsofphp/php-cs-fixer": "^3.2", "phpstan/phpstan": "^0.12.69", "phpunit/phpunit": "^9.5" },