Contao\CoreBundle\Config\Dumper\CombinedFileDumper::dump PHP Method

dump() public method

public dump ( $files, $cacheFile, array $options = [] )
$options array
    public function dump($files, $cacheFile, array $options = [])
    {
        $type = isset($options['type']) ? $options['type'] : null;
        $buffer = $this->header;
        foreach ((array) $files as $file) {
            if ($this->addNamespace) {
                $buffer .= "\nnamespace {";
            }
            $buffer .= $this->loader->load($file, $type);
            if ($this->addNamespace) {
                $buffer .= "\n}\n";
            }
        }
        $this->filesystem->dumpFile($this->cacheDir . '/' . $cacheFile, $buffer);
    }

Usage Example

 /**
  * Tests setting a valid header.
  */
 public function testValidHeader()
 {
     $dumper = new CombinedFileDumper($this->mockFilesystem("<?php\necho 'foo';\necho 'test';\n"), $this->mockLoader(), $this->getCacheDir());
     $dumper->setHeader("<?php\necho 'foo';");
     $dumper->dump(['test.php'], 'test.php');
 }
All Usage Examples Of Contao\CoreBundle\Config\Dumper\CombinedFileDumper::dump