From 4170e75ab46ae9786ff03ebb879d6e07f1c75a00 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Wed, 19 Jun 2024 19:36:23 +0200 Subject: [PATCH 1/3] [TASK] Update PHP-CS-Fixer --- .phive/phars.xml | 2 +- config/php-cs-fixer.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.phive/phars.xml b/.phive/phars.xml index 8b65eea8..a19b8834 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,4 +1,4 @@ - + diff --git a/config/php-cs-fixer.php b/config/php-cs-fixer.php index 76f52077..066dce06 100644 --- a/config/php-cs-fixer.php +++ b/config/php-cs-fixer.php @@ -1,8 +1,6 @@ setRiskyAllowed(true) @@ -21,6 +19,9 @@ '@PHPUnit75Migration:risky' => true, '@PHPUnit84Migration:risky' => true, + // needed for PHP 7.x + 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays', 'match']], + 'php_unit_construct' => true, 'php_unit_dedicate_assert' => ['target' => 'newest'], 'php_unit_expectation' => ['target' => 'newest'], From 66de96c9839cc9ef82e6c44cd2cc938cd4843b33 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Thu, 20 Jun 2024 09:36:29 +0200 Subject: [PATCH 2/3] Disallow trailing comma after multiline heredoc --- config/php-cs-fixer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/php-cs-fixer.php b/config/php-cs-fixer.php index 066dce06..53d242c1 100644 --- a/config/php-cs-fixer.php +++ b/config/php-cs-fixer.php @@ -20,7 +20,7 @@ '@PHPUnit84Migration:risky' => true, // needed for PHP 7.x - 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays', 'match']], + 'trailing_comma_in_multiline' => ['after_heredoc' => false, 'elements' => ['arrays', 'match']], 'php_unit_construct' => true, 'php_unit_dedicate_assert' => ['target' => 'newest'], From 3f94efdf13ad6d4679998e296d1dab666ac3711d Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Fri, 21 Jun 2024 21:50:17 +0200 Subject: [PATCH 3/3] Make the PHP 7 thing more clear --- config/php-cs-fixer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/php-cs-fixer.php b/config/php-cs-fixer.php index 53d242c1..bc449156 100644 --- a/config/php-cs-fixer.php +++ b/config/php-cs-fixer.php @@ -19,8 +19,8 @@ '@PHPUnit75Migration:risky' => true, '@PHPUnit84Migration:risky' => true, - // needed for PHP 7.x - 'trailing_comma_in_multiline' => ['after_heredoc' => false, 'elements' => ['arrays', 'match']], + // overwrite the PER2 defaults to restore compatibility with PHP 7.x + 'trailing_comma_in_multiline' => ['elements' => ['arrays', 'match']], 'php_unit_construct' => true, 'php_unit_dedicate_assert' => ['target' => 'newest'],