public function macroElse(MacroNode $node, PhpWriter $writer)
{
if ($node->modifiers) {
throw new CompileException('Modifiers are not allowed in ' . $node->getNotation());
} elseif ($node->args) {
$hint = Helpers::startsWith($node->args, 'if') ? ', did you mean {elseif}?' : '';
throw new CompileException('Arguments are not allowed in ' . $node->getNotation() . $hint);
}
$ifNode = $node->parentNode;
if ($ifNode && $ifNode->name === 'if' && $ifNode->data->capture) {
if (isset($ifNode->data->else)) {
throw new CompileException('Macro {if} supports only one {else}.');
}
$ifNode->data->else = TRUE;
return 'ob_start(function () {})';
}
return '} else {';
}