Browscap\Writer\XmlWriter::fileStart PHP Method

fileStart() public method

Generates a start sequence for the output file
public fileStart ( ) : Browscap\Writer\WriterInterface
return Browscap\Writer\WriterInterface
    public function fileStart()
    {
        if ($this->isSilent()) {
            return $this;
        }
        fputs($this->file, '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL);
        fputs($this->file, '<browsercaps>' . PHP_EOL);
        return $this;
    }

Usage Example

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