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);
}
/** * 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'); }