From 346305aadc0c9944de9f6ae2aad8f77b1ef90a83 Mon Sep 17 00:00:00 2001 From: Kevin Bond Date: Thu, 6 May 2021 18:01:16 -0400 Subject: [PATCH] [minor] update php-cs-fixer to v3 --- .github/workflows/ci.yml | 4 ++-- .gitignore | 2 +- .php_cs.dist => .php-cs-fixer.dist.php | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) rename .php_cs.dist => .php-cs-fixer.dist.php (92%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27c6149..d4f5898 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,7 +129,7 @@ jobs: with: php-version: 7.4 coverage: none - tools: php-cs-fixer:2.18.3 + tools: php-cs-fixer - name: Check CS - run: php-cs-fixer fix --dry-run --diff --diff-format=udiff + run: php-cs-fixer fix --dry-run --diff diff --git a/.gitignore b/.gitignore index 7647180..aa58d4a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,5 @@ /build/ /var/ /drivers/ -/.php_cs.cache +/.php-cs-fixer.cache /.phpunit.result.cache diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 92% rename from .php_cs.dist rename to .php-cs-fixer.dist.php index 8c09287..eaae762 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.dist.php @@ -5,8 +5,10 @@ ->notName('*.tpl.php') ; -return PhpCsFixer\Config::create() - ->setRules(array( +$config = new PhpCsFixer\Config(); + +return $config + ->setRules([ '@Symfony' => true, '@Symfony:risky' => true, '@DoctrineAnnotation' => true, @@ -20,7 +22,7 @@ 'imports_order' => ['const', 'class', 'function'], ], 'ordered_class_elements' => true, - 'native_function_invocation' => true, + 'native_function_invocation' => ['include' => ['@internal']], 'explicit_indirect_variable' => true, 'explicit_string_variable' => true, 'escape_implicit_backslashes' => true, @@ -41,7 +43,7 @@ 'phpdoc_to_comment' => false, 'function_declaration' => ['closure_function_spacing' => 'none'], 'nullable_type_declaration_for_default_null_value' => true, - )) + ]) ->setRiskyAllowed(true) ->setFinder($finder) ;