Heredoc/nowdoc content must be properly indented. Requires PHP >= 7.3.
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
@@ -1,5 +1,5 @@
<?php
$a = <<<EOD
-abc
- def
-EOD;
+ abc
+ def
+ EOD;
Default configuration.
--- Original
+++ New
@@ -1,5 +1,5 @@
<?php
$a = <<<'EOD'
-abc
- def
-EOD;
+ abc
+ def
+ EOD;
With configuration: ['indentation' => 'same_as_start']
.
--- Original
+++ New
@@ -1,5 +1,5 @@
<?php
$a = <<<'EOD'
-abc
- def
-EOD;
+ abc
+ def
+ EOD;
The rule is part of the following rule sets:
- @PHP73Migration
- Using the @PHP73Migration rule set will enable the
heredoc_indentation
rule with the default config. - @PHP74Migration
- Using the @PHP74Migration rule set will enable the
heredoc_indentation
rule with the default config. - @PHP80Migration
- Using the @PHP80Migration rule set will enable the
heredoc_indentation
rule with the default config.