diff --git a/src/Config/Config.php b/src/Config/Config.php index e4460e1..b7b3c87 100644 --- a/src/Config/Config.php +++ b/src/Config/Config.php @@ -193,6 +193,20 @@ public function saveFile($path, $data) return file_put_contents($filePath, $result); } + /** + * @param array $storage + * + * @return Slice + */ + public function make(array $storage) + { + return new Slice( + $this->helper, + $storage, + $this->withParameters ? $this->parameters : null + ); + } + /** * @param string $file * @@ -204,11 +218,7 @@ protected function slice($file) { $require = $this->requireFile($file); - $this->storage[$file] = new Slice( - $this->helper, - $require, - $this->withParameters ? $this->parameters : null - ); + $this->storage[$file] = $this->make($require); } return $this->storage[$file]; @@ -241,4 +251,4 @@ public function get($path) return $slice; } -} \ No newline at end of file +}