
heredoc_indentation
¶Heredoc/nowdoc content must be properly indented. Requires PHP >= 7.3.
indentation
¶Whether the indentation should be the same as in the start token line or one level more.
Allowed values: 'same_as_start'
, 'start_plus_one'
Default value: 'start_plus_one'
Default configuration.
--- Original
+++ New
<?php
$a = <<<EOD
-abc
- def
-EOD;
+ abc
+ def
+ EOD;
Default configuration.
--- Original
+++ New
<?php
$a = <<<'EOD'
-abc
- def
-EOD;
+ abc
+ def
+ EOD;
With configuration: ['indentation' => 'same_as_start']
.
--- Original
+++ New
<?php
$a = <<<'EOD'
-abc
- def
-EOD;
+ abc
+ def
+ EOD;
The rule is part of the following rule sets:
Using the @PHP73Migration rule set will enable the heredoc_indentation
rule with the default config.
Using the @PHP74Migration rule set will enable the heredoc_indentation
rule with the default config.
Using the @PHP80Migration rule set will enable the heredoc_indentation
rule with the default config.
Using the @PHP81Migration rule set will enable the heredoc_indentation
rule with the default config.
Using the @PHP82Migration rule set will enable the heredoc_indentation
rule with the default config.