Browscap\Generator\AbstractBuildGenerator::preBuild PHP Method

preBuild() protected method

runs before the build
protected preBuild ( ) : AbstractBuildGenerator
return AbstractBuildGenerator
    protected function preBuild()
    {
        $this->getLogger()->info('Resource folder: ' . $this->resourceFolder . '');
        $this->getLogger()->info('Build folder: ' . $this->buildFolder . '');
        return $this;
    }

Usage Example

 /**
  * runs before the build
  *
  * @param array       $fields
  * @param string|null $file
  * @param string      $format
  *
  * @return \Browscap\Generator\BuildCustomFileGenerator
  */
 protected function preBuild($fields = [], $file = null, $format = self::OUTPUT_FORMAT_PHP)
 {
     parent::preBuild();
     $this->getLogger()->info('started creating the custom output file');
     if (null === $this->collectionCreator) {
         $this->setCollectionCreator(new CollectionCreator());
     }
     if (null === $this->writerCollection) {
         $factory = new Writer\Factory\CustomWriterFactory();
         $this->setWriterCollection($factory->createCollection($this->getLogger(), $this->buildFolder, $file, $fields, $format));
     }
     return $this;
 }