Convert multiline string to heredoc
or nowdoc
.
--- Original
+++ New
<?php
-$a = 'line1
-line2';
+$a = <<<'EOD'
+line1
+line2
+EOD;
--- Original
+++ New
<?php
-$a = "line1
-{$obj->getName()}";
+$a = <<<EOD
+line1
+{$obj->getName()}
+EOD;
- Fixer class: PhpCsFixer\Fixer\StringNotation\MultilineStringToHeredocFixer
- Test class: PhpCsFixer\Tests\Fixer\StringNotation\MultilineStringToHeredocFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.