From 6faf8b66d91f79b27ff56fd722b9f51dedac14c7 Mon Sep 17 00:00:00 2001 From: Florian Wessels <flo.wessels@gmail.com> Date: Fri, 18 Jun 2021 07:36:03 +0200 Subject: [PATCH] [TASK] Update php-cs-fixer to version 3 --- .gitattributes | 2 +- .php_cs => php-cs-fixer.php | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) rename .php_cs => php-cs-fixer.php (88%) diff --git a/.gitattributes b/.gitattributes index 51b48d9..9324dcd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,5 +5,5 @@ /Tests/ export-ignore /.gitattributes export-ignore /.gitignore export-ignore -/.php_cs export-ignore +/php-cs-fixer.php export-ignore /.travis.yml export-ignore diff --git a/.php_cs b/php-cs-fixer.php similarity index 88% rename from .php_cs rename to php-cs-fixer.php index c48e640..25437fc 100644 --- a/.php_cs +++ b/php-cs-fixer.php @@ -15,16 +15,16 @@ Florian Wessels <f.wessels@Leuchtfeuer.com>, Leuchtfeuer Digital Marketing COMMENT; - -$finder = PhpCsFixer\Finder::create() +$finder = (new PhpCsFixer\Finder()) ->name('*.php') ->in(__DIR__) ->exclude('Libraries') ->exclude('Resources') ->notName('ext_emconf.php') - ->notName('ext_localconf.php'); + ->notName('ext_localconf.php') + ->notName('php-cs-fixer.php'); -return PhpCsFixer\Config::create() +return (new PhpCsFixer\Config()) ->setRiskyAllowed(true) ->setRules([ '@DoctrineAnnotation' => true, @@ -38,7 +38,6 @@ 'declare_equal_normalize' => ['space' => 'none'], 'dir_constant' => true, 'function_typehint_space' => true, - 'hash_to_slash_comment' => true, 'header_comment' => [ 'header' => $headerComment, 'comment_type' => 'comment', @@ -54,7 +53,7 @@ 'no_blank_lines_after_phpdoc' => true, 'no_empty_phpdoc' => true, 'no_empty_statement' => true, - 'no_extra_consecutive_blank_lines' => true, + 'no_extra_blank_lines' => true, 'no_leading_import_slash' => true, 'no_leading_namespace_whitespace' => true, 'no_null_property_initialization' => true, @@ -67,7 +66,7 @@ 'no_useless_else' => true, 'no_whitespace_in_blank_line' => true, 'ordered_imports' => true, - 'php_unit_construct' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame'], + 'php_unit_construct' => ['assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame']], 'php_unit_mock_short_will_return' => true, 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], 'phpdoc_no_access' => true, @@ -79,6 +78,7 @@ 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], 'return_type_declaration' => ['space_before' => 'none'], 'single_quote' => true, + 'single_line_comment_style' => ['comment_types' => ['hash']], 'single_trait_insert_per_statement' => true, 'whitespace_after_comma_in_array' => true, ])