Browscap\Writer\XmlWriter::fileEnd PHP Method

fileEnd() public method

Generates a end sequence for the output file
public fileEnd ( ) : Browscap\Writer\WriterInterface
return Browscap\Writer\WriterInterface
    public function fileEnd()
    {
        if ($this->isSilent()) {
            return $this;
        }
        fputs($this->file, '</browsercaps>' . PHP_EOL);
        return $this;
    }

Usage Example

Example #1
0
 /**
  * tests rendering the end of the file
  *
  * @group writer
  * @group sourcetest
  */
 public function testFileEndIfSilent()
 {
     $this->object->setSilent(true);
     self::assertSame($this->object, $this->object->fileEnd());
     self::assertSame('', file_get_contents($this->file));
 }