public function write(Document $document, $webDir) { $target = $webDir . '/' . $document->getPath(); $this->filesystem->mkdir(dirname($target)); file_put_contents($target, $document->getBodyDecorated()); }