From 9cc2f2affb259c21f257065b6d34d3b4e2867917 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 9 Jun 2021 12:19:52 +0200 Subject: [PATCH] Upgrade to PHP-CS-Fixer 3 see WoltLab/WCF#4183 --- .github/workflows/codestyle.yml | 4 ++-- .php_cs.dist => .php-cs-fixer.dist.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename .php_cs.dist => .php-cs-fixer.dist.php (95%) diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index 51c8aa4..103e424 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -22,6 +22,6 @@ jobs: with: php-version: '7.4' extensions: ctype, dom, exif, gd, gmp, hash, intl, json, libxml, mbstring, opcache, pcre, pdo, pdo_mysql, zlib - tools: php-cs-fixer:2.19.0 + tools: php-cs-fixer - name: php-cs-fixer - run: php-cs-fixer fix --dry-run --diff-format udiff + run: php-cs-fixer fix --dry-run --diff diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 95% rename from .php_cs.dist rename to .php-cs-fixer.dist.php index 9754205..312569b 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.dist.php @@ -21,7 +21,6 @@ return (new PhpCsFixer\Config()) 'no_trailing_comma_in_singleline_array' => true, 'no_whitespace_before_comma_in_array' => true, 'normalize_index_brace' => true, - 'trailing_comma_in_multiline_array' => true, 'whitespace_after_comma_in_array' => true, 'non_printable_character' => ['use_escape_sequences_in_strings' => true], @@ -47,17 +46,18 @@ return (new PhpCsFixer\Config()) 'no_empty_comment' => true, 'single_line_comment_style' => ['comment_types' => ['hash']], - 'native_constant_invocation' => true, + 'native_constant_invocation' => ['strict' => false], 'no_alternative_syntax' => true, 'no_trailing_comma_in_list_call' => true, 'no_unneeded_control_parentheses' => ['statements' => ['break', 'clone', 'continue', 'echo_print', 'return', 'switch_case', 'yield', 'yield_from']], 'no_unneeded_curly_braces' => ['namespaces' => true], 'switch_continue_to_break' => true, + 'trailing_comma_in_multiline' => ['elements' => ['arrays']], 'function_typehint_space' => true, 'lambda_not_used_import' => true, - 'native_function_invocation' => true, + 'native_function_invocation' => ['include' => ['@internal']], 'no_unreachable_default_argument_value' => true, 'nullable_type_declaration_for_default_null_value' => true, 'return_type_declaration' => true, -- 2.20.1