From a56e192c284ee82a32f0919e031b67c99b4aa9e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sat, 20 Jan 2024 13:31:50 +0100 Subject: [PATCH] Enhancement: Enable multiline_string_to_heredoc fixer --- CHANGELOG.md | 2 ++ src/RuleSet/Php53.php | 2 +- src/RuleSet/Php54.php | 2 +- src/RuleSet/Php55.php | 2 +- src/RuleSet/Php56.php | 2 +- src/RuleSet/Php70.php | 2 +- src/RuleSet/Php71.php | 2 +- src/RuleSet/Php72.php | 2 +- src/RuleSet/Php73.php | 2 +- src/RuleSet/Php74.php | 2 +- src/RuleSet/Php80.php | 2 +- src/RuleSet/Php81.php | 2 +- src/RuleSet/Php82.php | 2 +- src/RuleSet/Php83.php | 2 +- test/Unit/RuleSet/Php53Test.php | 2 +- test/Unit/RuleSet/Php54Test.php | 2 +- test/Unit/RuleSet/Php55Test.php | 2 +- test/Unit/RuleSet/Php56Test.php | 2 +- test/Unit/RuleSet/Php70Test.php | 2 +- test/Unit/RuleSet/Php71Test.php | 2 +- test/Unit/RuleSet/Php72Test.php | 2 +- test/Unit/RuleSet/Php73Test.php | 2 +- test/Unit/RuleSet/Php74Test.php | 2 +- test/Unit/RuleSet/Php80Test.php | 2 +- test/Unit/RuleSet/Php81Test.php | 2 +- test/Unit/RuleSet/Php82Test.php | 2 +- test/Unit/RuleSet/Php83Test.php | 2 +- 27 files changed, 28 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41925aa0..26ba483d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ For a full diff see [`6.19.0...main`][6.19.0...main]. - Updated `erickskrauch/php-cs-fixer-custom-fixers` ([#984]), by [@dependabot] - Updated `friendsofphp/php-cs-fixer` ([#993]), by [@dependabot] +- Enabled the `multiline_string_to_heredoc` fixer ([#994]), by [@localheinz] ## [`6.19.0`][6.19.0] @@ -1507,6 +1508,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [#979]: https://github.com/ergebnis/php-cs-fixer-config/pull/979 [#984]: https://github.com/ergebnis/php-cs-fixer-config/pull/984 [#993]: https://github.com/ergebnis/php-cs-fixer-config/pull/993 +[#994]: https://github.com/ergebnis/php-cs-fixer-config/pull/994 [@dependabot]: https://github.com/apps/dependabot [@linuxjuggler]: https://github.com/linuxjuggler diff --git a/src/RuleSet/Php53.php b/src/RuleSet/Php53.php index 4fcf766a..ac398a12 100644 --- a/src/RuleSet/Php53.php +++ b/src/RuleSet/Php53.php @@ -316,7 +316,7 @@ public static function create(): RuleSet 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/src/RuleSet/Php54.php b/src/RuleSet/Php54.php index 6397be64..98ca81c7 100644 --- a/src/RuleSet/Php54.php +++ b/src/RuleSet/Php54.php @@ -317,7 +317,7 @@ public static function create(): RuleSet 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/src/RuleSet/Php55.php b/src/RuleSet/Php55.php index 4f9271e9..18c17fc3 100644 --- a/src/RuleSet/Php55.php +++ b/src/RuleSet/Php55.php @@ -321,7 +321,7 @@ public static function create(): RuleSet 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/src/RuleSet/Php56.php b/src/RuleSet/Php56.php index 4473d2c9..0ac42f1a 100644 --- a/src/RuleSet/Php56.php +++ b/src/RuleSet/Php56.php @@ -321,7 +321,7 @@ public static function create(): RuleSet 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/src/RuleSet/Php70.php b/src/RuleSet/Php70.php index db0d1470..b4f3cf59 100644 --- a/src/RuleSet/Php70.php +++ b/src/RuleSet/Php70.php @@ -321,7 +321,7 @@ public static function create(): RuleSet 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/src/RuleSet/Php71.php b/src/RuleSet/Php71.php index 69adb2f8..c768c54f 100644 --- a/src/RuleSet/Php71.php +++ b/src/RuleSet/Php71.php @@ -321,7 +321,7 @@ public static function create(): RuleSet 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/src/RuleSet/Php72.php b/src/RuleSet/Php72.php index ec0d27ad..24cc6022 100644 --- a/src/RuleSet/Php72.php +++ b/src/RuleSet/Php72.php @@ -321,7 +321,7 @@ public static function create(): RuleSet 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/src/RuleSet/Php73.php b/src/RuleSet/Php73.php index 6eb1bc47..ddfe3247 100644 --- a/src/RuleSet/Php73.php +++ b/src/RuleSet/Php73.php @@ -321,7 +321,7 @@ public static function create(): RuleSet 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index 460097e3..1cfd018b 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -321,7 +321,7 @@ public static function create(): RuleSet 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index 74a2fa9b..621dc1f8 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -328,7 +328,7 @@ public static function create(): RuleSet 'modernize_strpos' => true, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index ab9795b5..caa0a88e 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -329,7 +329,7 @@ public static function create(): RuleSet 'modernize_strpos' => true, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/src/RuleSet/Php82.php b/src/RuleSet/Php82.php index 6ecf52ec..73f5575d 100644 --- a/src/RuleSet/Php82.php +++ b/src/RuleSet/Php82.php @@ -329,7 +329,7 @@ public static function create(): RuleSet 'modernize_strpos' => true, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/src/RuleSet/Php83.php b/src/RuleSet/Php83.php index 0cd5a579..4576012b 100644 --- a/src/RuleSet/Php83.php +++ b/src/RuleSet/Php83.php @@ -329,7 +329,7 @@ public static function create(): RuleSet 'modernize_strpos' => true, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/test/Unit/RuleSet/Php53Test.php b/test/Unit/RuleSet/Php53Test.php index d8682605..1d870d34 100644 --- a/test/Unit/RuleSet/Php53Test.php +++ b/test/Unit/RuleSet/Php53Test.php @@ -339,7 +339,7 @@ protected function expectedRules(): Rules 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/test/Unit/RuleSet/Php54Test.php b/test/Unit/RuleSet/Php54Test.php index 70b2bfeb..5e582a75 100644 --- a/test/Unit/RuleSet/Php54Test.php +++ b/test/Unit/RuleSet/Php54Test.php @@ -340,7 +340,7 @@ protected function expectedRules(): Rules 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/test/Unit/RuleSet/Php55Test.php b/test/Unit/RuleSet/Php55Test.php index b18733cb..88639e26 100644 --- a/test/Unit/RuleSet/Php55Test.php +++ b/test/Unit/RuleSet/Php55Test.php @@ -344,7 +344,7 @@ protected function expectedRules(): Rules 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/test/Unit/RuleSet/Php56Test.php b/test/Unit/RuleSet/Php56Test.php index 20a2e61e..41837d70 100644 --- a/test/Unit/RuleSet/Php56Test.php +++ b/test/Unit/RuleSet/Php56Test.php @@ -344,7 +344,7 @@ protected function expectedRules(): Rules 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/test/Unit/RuleSet/Php70Test.php b/test/Unit/RuleSet/Php70Test.php index 354463de..cf13fe31 100644 --- a/test/Unit/RuleSet/Php70Test.php +++ b/test/Unit/RuleSet/Php70Test.php @@ -344,7 +344,7 @@ protected function expectedRules(): Rules 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/test/Unit/RuleSet/Php71Test.php b/test/Unit/RuleSet/Php71Test.php index 816b0de4..919683bd 100644 --- a/test/Unit/RuleSet/Php71Test.php +++ b/test/Unit/RuleSet/Php71Test.php @@ -344,7 +344,7 @@ protected function expectedRules(): Rules 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/test/Unit/RuleSet/Php72Test.php b/test/Unit/RuleSet/Php72Test.php index 82088fe5..4e138f7a 100644 --- a/test/Unit/RuleSet/Php72Test.php +++ b/test/Unit/RuleSet/Php72Test.php @@ -344,7 +344,7 @@ protected function expectedRules(): Rules 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/test/Unit/RuleSet/Php73Test.php b/test/Unit/RuleSet/Php73Test.php index e9001fa3..aa4d4930 100644 --- a/test/Unit/RuleSet/Php73Test.php +++ b/test/Unit/RuleSet/Php73Test.php @@ -344,7 +344,7 @@ protected function expectedRules(): Rules 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/test/Unit/RuleSet/Php74Test.php b/test/Unit/RuleSet/Php74Test.php index b9777f34..62e9bddd 100644 --- a/test/Unit/RuleSet/Php74Test.php +++ b/test/Unit/RuleSet/Php74Test.php @@ -344,7 +344,7 @@ protected function expectedRules(): Rules 'modernize_strpos' => false, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/test/Unit/RuleSet/Php80Test.php b/test/Unit/RuleSet/Php80Test.php index 6239bdcc..db7b7623 100644 --- a/test/Unit/RuleSet/Php80Test.php +++ b/test/Unit/RuleSet/Php80Test.php @@ -351,7 +351,7 @@ protected function expectedRules(): Rules 'modernize_strpos' => true, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/test/Unit/RuleSet/Php81Test.php b/test/Unit/RuleSet/Php81Test.php index ce63f0ab..002a9047 100644 --- a/test/Unit/RuleSet/Php81Test.php +++ b/test/Unit/RuleSet/Php81Test.php @@ -352,7 +352,7 @@ protected function expectedRules(): Rules 'modernize_strpos' => true, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/test/Unit/RuleSet/Php82Test.php b/test/Unit/RuleSet/Php82Test.php index 1943d80f..a912fb52 100644 --- a/test/Unit/RuleSet/Php82Test.php +++ b/test/Unit/RuleSet/Php82Test.php @@ -352,7 +352,7 @@ protected function expectedRules(): Rules 'modernize_strpos' => true, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ], diff --git a/test/Unit/RuleSet/Php83Test.php b/test/Unit/RuleSet/Php83Test.php index 171ba95b..440cc558 100644 --- a/test/Unit/RuleSet/Php83Test.php +++ b/test/Unit/RuleSet/Php83Test.php @@ -352,7 +352,7 @@ protected function expectedRules(): Rules 'modernize_strpos' => true, 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, - 'multiline_string_to_heredoc' => false, + 'multiline_string_to_heredoc' => true, 'multiline_whitespace_before_semicolons' => [ 'strategy' => 'no_multi_line', ],