From abaa2f4e8a03311a0dd431f0135d9fef8a727a0b Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Mon, 1 Aug 2022 19:09:11 +0100 Subject: [PATCH 1/7] Rename .php_cs to .php-cs-fixer.dist.php --- .php_cs => .php-cs-fixer.dist.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .php_cs => .php-cs-fixer.dist.php (100%) diff --git a/.php_cs b/.php-cs-fixer.dist.php similarity index 100% rename from .php_cs rename to .php-cs-fixer.dist.php From 82ff002223a202c05d320c15daa244197b264410 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Mon, 1 Aug 2022 19:09:30 +0100 Subject: [PATCH 2/7] Ignore local .php-cs-fixer.php file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e204a2bf1..58bcc4e18 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ !var/sessions/.gitkeep /bin/* !/bin/console +.php-cs-fixer.php .php_cs.cache .phpunit.result.cache phpunit.xml From c73c6052b64706c6b9b592f02bb514e9b190bf02 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Mon, 1 Aug 2022 19:11:30 +0100 Subject: [PATCH 3/7] Ignore .php-cs-fixer.cache as cache file --- .gitignore | 2 +- .php-cs-fixer.dist.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 58bcc4e18..2504e972d 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,7 @@ /bin/* !/bin/console .php-cs-fixer.php -.php_cs.cache +.php-cs-fixer.cache .phpunit.result.cache phpunit.xml diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 9ee02779b..0dce4a947 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -45,4 +45,5 @@ return PhpCsFixer\Config::create() ]) ->in(__DIR__) ) + ->setCacheFile('.php-cs-fixer.cache') ; From 2c7c39ed87d232ab0336f328f635b037dd540c06 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Mon, 1 Aug 2022 19:15:15 +0100 Subject: [PATCH 4/7] Use new rule names --- .php-cs-fixer.dist.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 0dce4a947..c49c799c7 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -10,7 +10,7 @@ return PhpCsFixer\Config::create() ], 'combine_consecutive_unsets' => true, 'heredoc_to_nowdoc' => true, - 'no_extra_consecutive_blank_lines' => [ + 'no_extra_blank_lines' => [ 'break', 'continue', 'extra', @@ -28,7 +28,7 @@ return PhpCsFixer\Config::create() 'ordered_imports' => true, 'php_unit_strict' => true, 'phpdoc_order' => true, - // 'psr4' => true, + // 'psr_autoloading' => true, 'strict_comparison' => true, 'strict_param' => true, 'concat_space' => [ From 569eca03968fbbfd6eec50cd59de506d88b3d701 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Mon, 1 Aug 2022 19:15:32 +0100 Subject: [PATCH 5/7] Fix indentation --- .php-cs-fixer.dist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index c49c799c7..635b00ddd 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -11,7 +11,7 @@ return PhpCsFixer\Config::create() 'combine_consecutive_unsets' => true, 'heredoc_to_nowdoc' => true, 'no_extra_blank_lines' => [ - 'break', + 'break', 'continue', 'extra', 'return', From 5d736d874c6b647c7a64793de453497d50aee692 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Mon, 1 Aug 2022 19:16:02 +0100 Subject: [PATCH 6/7] FIx deprecation in no_extra_blank_lines --- .php-cs-fixer.dist.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 635b00ddd..dc462420f 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -11,15 +11,17 @@ return PhpCsFixer\Config::create() 'combine_consecutive_unsets' => true, 'heredoc_to_nowdoc' => true, 'no_extra_blank_lines' => [ - 'break', - 'continue', - 'extra', - 'return', - 'throw', - 'use', - 'parenthesis_brace_block', - 'square_brace_block', - 'curly_brace_block' + 'tokens' => [ + 'break', + 'continue', + 'extra', + 'return', + 'throw', + 'use', + 'parenthesis_brace_block', + 'square_brace_block', + 'curly_brace_block' + ], ], 'no_unreachable_default_argument_value' => true, 'no_useless_else' => true, From ef9183f6c1c237cecc6d3364afd97ae0f9ef35b5 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Mon, 1 Aug 2022 19:18:49 +0100 Subject: [PATCH 7/7] Use Config constructor instead of deprecated named one --- .php-cs-fixer.dist.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index dc462420f..a64299b8b 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,6 +1,7 @@ setRiskyAllowed(true) ->setRules([ '@Symfony' => true,