Heredoc/nowdoc content must be properly indented.
Whether the indentation should be the same as in the start token line or one level more.
Allowed values: 'same_as_start'
and 'start_plus_one'
Default value: 'start_plus_one'
Default configuration.
--- Original
+++ New
<?php
$heredoc = <<<EOD
-abc
- def
-EOD;
+ abc
+ def
+ EOD;
$nowdoc = <<<'EOD'
-abc
- def
-EOD;
+ abc
+ def
+ EOD;
With configuration: ['indentation' => 'same_as_start']
.
--- Original
+++ New
<?php
$nowdoc = <<<'EOD'
-abc
- def
-EOD;
+ abc
+ def
+ EOD;
The rule is part of the following rule sets:
- @PHP73Migration
- @PHP74Migration
- @PHP80Migration
- @PHP81Migration
- @PHP82Migration
- @PHP83Migration
- @PHP84Migration
- Fixer class: PhpCsFixer\Fixer\Whitespace\HeredocIndentationFixer
- Test class: PhpCsFixer\Tests\Fixer\Whitespace\HeredocIndentationFixerTest
The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.