code: public function config($key, $value = null) {
          if (is_array($key))
              $this->config = $key + $this->config;
          else {
              if ($value !== null) $this->config[$key] = $value;
              if (!isset($this->config[$key]))
                  throw new \Exception("Configuration key `type` is not set");
              return $this->config[$key];
          }
      }
docs: Get or set a config
  
  @param string $key
  @param mixed $value
  @throws \Exception
  @return array|void