protected function renderPhpStatements($code, $statements = null)
{
if ($statements === null) {
return $code;
}
$codeFormat = array_pop($statements);
array_unshift($codeFormat, $code);
if (count($statements) === 0) {
return call_user_func_array('sprintf', $codeFormat);
}
$stmtString = '';
foreach ($statements as $stmt) {
$stmtString .= $this->newline() . $this->indent() . $stmt . ';';
}
$stmtString .= $this->newline() . $this->indent();
$stmtString .= call_user_func_array('sprintf', $codeFormat);
return $stmtString . $this->newline() . $this->indent();
}