Unify heredoc
or nowdoc
closing marker.
Preferred closing marker.
Allowed types: string
Default value: 'EOD'
Whether the closing marker should be wrapped in double quotes.
Allowed types: bool
Default value: false
Reserved closing markers to be kept unchanged.
Allowed types: list<string>
Default value: ['CSS', 'DIFF', 'HTML', 'JS', 'JSON', 'MD', 'PHP', 'PYTHON', 'RST', 'TS', 'SQL', 'XML', 'YAML']
Default configuration.
--- Original
+++ New
-<?php $a = <<<"TEST"
+<?php $a = <<<EOD
Foo
-TEST;
+EOD;
With configuration: ['closing_marker' => 'EOF']
.
--- Original
+++ New
-<?php $a = <<<'TEST'
+<?php $a = <<<'EOF'
Foo
-TEST;
+EOF;
With configuration: ['explicit_heredoc_style' => true]
.
--- Original
+++ New
-<?php $a = <<<EOD
+<?php $a = <<<"EOD"
Foo
EOD;
- Fixer class: PhpCsFixer\Fixer\StringNotation\HeredocClosingMarkerFixer
- Test class: PhpCsFixer\Tests\Fixer\StringNotation\HeredocClosingMarkerFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.