Fix InlineHTML indentation

This commit is contained in:
Nikita Popov 2017-09-03 19:02:07 +02:00
parent b1cd07a7b5
commit ec8692fb9e
2 changed files with 17 additions and 1 deletions

View File

@ -832,7 +832,7 @@ class Standard extends PrettyPrinterAbstract
}
protected function pStmt_InlineHTML(Stmt\InlineHTML $node) {
$newline = $node->getAttribute('hasLeadingNewline', true) ? $this->nl : '';
$newline = $node->getAttribute('hasLeadingNewline', true) ? "\n" : '';
return '?>' . $newline . $node->value . '<?php ';
}

View File

@ -0,0 +1,16 @@
InlineHTML node nested inside other code
-----
<?php
function test() {
?>
Test
<?php
}
-----
function test()
{
?>
Test
<?php
}