Skip to content

Commit

Permalink
[Printer] Ensure disable flag isRequireReprintInlineHTML on change fi…
Browse files Browse the repository at this point in the history
…le on MixPhpHtmlDecorator (#3383)
  • Loading branch information
samsonasik committed Feb 15, 2023
1 parent a9e4d4b commit 24a976b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/NodeDecorator/MixPhpHtmlDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public function isRequireReprintInlineHTML(): bool
return $this->isRequireReprintInlineHTML;
}

public function disableIsRequireReprintInlineHTML(): void
{
$this->isRequireReprintInlineHTML = false;
}

/**
* @param array<Node|null> $nodes
*/
Expand Down
3 changes: 3 additions & 0 deletions src/PhpParser/Printer/BetterStandardPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ public function printFormatPreserving(array $stmts, array $origStmts, array $ori
return $content;
}

// ensure disable flag isRequireReprintInlineHTML on change file
$this->mixPhpHtmlDecorator->disableIsRequireReprintInlineHTML();

$content = $this->cleanSurplusTag($content);
return $this->cleanEndWithPHPOpenTag($content);
}
Expand Down

0 comments on commit 24a976b

Please sign in to comment.