public function finalize(ContextInterface $context, $endLineNumber) { if (!$this->open) { return; // TODO: Throw AlreadyClosedException? } $this->open = false; $this->endLine = $endLineNumber; $context->setTip($context->getTip()->parent()); }
public function closeUnmatchedBlocks() { while ($this->oldTip !== $this->lastMatchedContainer) { $this->oldTip->finalize($this->context); $this->oldTip = $this->oldTip->getParent(); } }