public function prettyPrintFile(array $stmts)
{
if (!$stmts) {
return "<?php\n\n";
}
$p = "<?php\n\n" . $this->prettyPrint($stmts);
if ($stmts[0] instanceof Stmt\InlineHTML) {
$p = preg_replace('/^<\\?php\\s+\\?>\\n?/', '', $p);
}
if ($stmts[count($stmts) - 1] instanceof Stmt\InlineHTML) {
$p = preg_replace('/<\\?php$/', '', rtrim($p));
}
return $p;
}