Author: Thomas Müller (t_mueller_stolzenhain@yahoo.de)
Inheritance: implements Browscap\Writer\WriterInterface
 /**
  * @param \Psr\Log\LoggerInterface $logger
  * @param string                   $buildFolder
  *
  * @return \Browscap\Writer\WriterCollection
  */
 public function createCollection(LoggerInterface $logger, $buildFolder)
 {
     $writerCollection = new WriterCollection();
     $fullFilter = new FullFilter();
     $stdFilter = new StandardFilter();
     $liteFilter = new LiteFilter();
     $fullAspWriter = new IniWriter($buildFolder . '/full_asp_browscap.ini');
     $formatter = new AspFormatter();
     $fullAspWriter->setLogger($logger)->setFormatter($formatter->setFilter($fullFilter))->setFilter($fullFilter);
     $writerCollection->addWriter($fullAspWriter);
     $fullPhpWriter = new IniWriter($buildFolder . '/full_php_browscap.ini');
     $formatter = new PhpFormatter();
     $fullPhpWriter->setLogger($logger)->setFormatter($formatter->setFilter($fullFilter))->setFilter($fullFilter);
     $writerCollection->addWriter($fullPhpWriter);
     $stdAspWriter = new IniWriter($buildFolder . '/browscap.ini');
     $formatter = new AspFormatter();
     $stdAspWriter->setLogger($logger)->setFormatter($formatter->setFilter($stdFilter))->setFilter($stdFilter);
     $writerCollection->addWriter($stdAspWriter);
     $stdPhpWriter = new IniWriter($buildFolder . '/php_browscap.ini');
     $formatter = new PhpFormatter();
     $stdPhpWriter->setLogger($logger)->setFormatter($formatter->setFilter($stdFilter))->setFilter($stdFilter);
     $writerCollection->addWriter($stdPhpWriter);
     $liteAspWriter = new IniWriter($buildFolder . '/lite_asp_browscap.ini');
     $formatter = new AspFormatter();
     $liteAspWriter->setLogger($logger)->setFormatter($formatter->setFilter($liteFilter))->setFilter($liteFilter);
     $writerCollection->addWriter($liteAspWriter);
     $litePhpWriter = new IniWriter($buildFolder . '/lite_php_browscap.ini');
     $formatter = new PhpFormatter();
     $litePhpWriter->setLogger($logger)->setFormatter($formatter->setFilter($liteFilter))->setFilter($liteFilter);
     $writerCollection->addWriter($litePhpWriter);
     $csvWriter = new CsvWriter($buildFolder . '/browscap.csv');
     $formatter = new CsvFormatter();
     $csvWriter->setLogger($logger)->setFormatter($formatter->setFilter($fullFilter))->setFilter($fullFilter);
     $writerCollection->addWriter($csvWriter);
     $xmlWriter = new XmlWriter($buildFolder . '/browscap.xml');
     $formatter = new XmlFormatter();
     $xmlWriter->setLogger($logger)->setFormatter($formatter->setFilter($stdFilter))->setFilter($stdFilter);
     $writerCollection->addWriter($xmlWriter);
     $jsonWriter = new JsonWriter($buildFolder . '/browscap.json');
     $formatter = new JsonFormatter();
     $jsonWriter->setLogger($logger)->setFormatter($formatter->setFilter($fullFilter))->setFilter($fullFilter);
     $writerCollection->addWriter($jsonWriter);
     $liteJsonWriter = new JsonWriter($buildFolder . '/lite_browscap.json');
     $formatter = new JsonFormatter();
     $liteJsonWriter->setLogger($logger)->setFormatter($formatter->setFilter($liteFilter))->setFilter($liteFilter);
     $writerCollection->addWriter($liteJsonWriter);
     return $writerCollection;
 }
Beispiel #2
0
 /**
  * tests rendering the footer after all divisions
  *
  * @group writer
  * @group sourcetest
  */
 public function testRenderAllDivisionsFooter()
 {
     self::assertSame($this->object, $this->object->renderAllDivisionsFooter());
     self::assertSame('', file_get_contents($this->file));
 }