Fireguard\Report\Exporters\ImageExporter::configure PHP Méthode

configure() public méthode

public configure ( array $config = [] ) : Fireguard\Report\Contracts\ExporterContract
$config array
Résultat Fireguard\Report\Contracts\ExporterContract
    public function configure(array $config = [])
    {
        $this->extension = '.' . strtolower($this->format);
        $defaultConfig = $this->getDefaultConfiguration();
        $this->config = array_replace_recursive($defaultConfig['image'], $config);
        $this->setConfigDefaultOptions($this->config['phantom']);
        $this->commandOptions = $this->configDefaultOptions;
        $this->setBinaryPath((new PhantomBinary())->getBin());
        return $this;
    }

Usage Example

 public function testGetFooterHeight()
 {
     $exporter = new ImageExporter();
     $exporter->configure(['footer' => ['height' => '0px']]);
     $this->assertEquals('0px', $exporter->getFooterHeight());
     $exporter->configure(['footer' => ['height' => '100px']]);
     $this->assertEquals('100px', $exporter->getFooterHeight());
 }