public function setConfig(array $config = []) { $config = $config + $this->config; foreach ($this->defaults as $key => $value) { if (!array_key_exists($key, $config)) { $config[$key] = $value; } } $this->config = $config; return $this; }