public function __construct($path = null, $namespace = null) { if (is_dir($path)) { $dir = new Directory($path); $this->config = ['default' => $this->expand($dir->parse(), $namespace)]; foreach ($dir->getContexts() as $context) { $this->config[$context] = array_merge($this->config['default'], $this->expand($dir->parse($context), $namespace)); } } else { if (is_file($path)) { $this->config[$this->context] = $this->expand(File::read($path), $namespace); } } }