From c77c47d7f9df26b3f6895375ce0d64763f08c75e Mon Sep 17 00:00:00 2001 From: Shuvro Roy Date: Mon, 24 May 2021 17:05:22 +0600 Subject: [PATCH] Migrate to PHP-CS-Fixer 3.x --- .github/workflows/ci.yml | 2 +- .gitignore | 2 +- .php_cs.php => .php-cs-fixer.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename .php_cs.php => .php-cs-fixer.php (98%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 517d324..6a42120 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: - name: Install php-cs-fixer run: composer global require friendsofphp/php-cs-fixer - name: Run php-cs-fixer - run: $HOME/.composer/vendor/bin/php-cs-fixer fix --config=.php_cs.php + run: $HOME/.composer/vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php - name: Commit changes from php-cs-fixer uses: EndBug/add-and-commit@v5 with: diff --git a/.gitignore b/.gitignore index d9c3777..a683006 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ package-lock.json composer.lock vendor/ -.php_cs.cache +.php-cs-fixer.cache .vscode/ coverage/ node_modules diff --git a/.php_cs.php b/.php-cs-fixer.php similarity index 98% rename from .php_cs.php rename to .php-cs-fixer.php index 4841dd7..3ac1448 100644 --- a/.php_cs.php +++ b/.php-cs-fixer.php @@ -42,7 +42,7 @@ $rules = [ 'linebreak_after_opening_tag' => true, 'line_ending' => true, 'lowercase_cast' => true, - 'lowercase_constants' => true, + 'constant_case' => true, 'lowercase_keywords' => true, 'lowercase_static_reference' => true, // added from Symfony 'magic_method_casing' => true, // added from Symfony @@ -137,7 +137,7 @@ $finder = Finder::create() ->ignoreDotFiles(true) ->ignoreVCS(true); -return Config::create() +return (new Config()) ->setFinder($finder) ->setRules($rules) ->setRiskyAllowed(true)