/** * @return $this */ public function write() { $this->filter(); $this->target->getDir()->create(); $this->target->write($this->content); return $this; }
/** * {@inheritdoc} */ public function write(Config $config, $target) { $file = new File($target); if ($file->exists()) { throw new \LogicException(sprintf("Config target file already exists '%s'", $target)); } $data = sprintf("<?php\n\n// \nreturn %s;\n", var_export($config->getData(), true)); $file->write($data); return $this; }