/** * @inheritdoc */ public function end() { if (!$this->writer) { throw new \LogicException('Start writer first'); } $this->write(sprintf('</%s>', $this->rootNode)); $this->writer->endDocument(); $this->flush(); $this->writer = null; }
/** * @expectedException \LogicException */ public function testEndWithoutStart() { $writer = new XmlWriter(new TempFile()); $writer->end(); }