public function __construct(Document $document, Environment $environment) { $this->doc = $document; $this->tip = $this->doc; $this->container = $this->doc; $this->environment = $environment; $this->referenceParser = new ReferenceParser($document->getReferenceMap()); $this->blockCloser = new UnmatchedBlockCloser($this); }