/** * {@inheritdoc} */ public function get($key, $default = null) { if ($this->local->has($key)) { $value = $this->local->get($key, $default); if (is_array($value) && $this->global->has($key)) { $value = ArrayUtil::merge((array) $this->global->get($key), $value); } return $value; } return $this->global->get($key, $default); }
/** * Merge config values into config. * * @param array $data New data. * @param null $path Optional sub path where to merge in. * * @return $this */ public function merge(array $data, $path = null) { if ($path) { $config = (array) $this->get($path); $config = ArrayUtil::merge($config, $data); $this->set($path, $config); } else { $this->config = ArrayUtil::merge($this->config, $data); } return $this; }