public function set($key, $value)
{
if (is_null($key)) {
throw new InvalidArgumentException('Invalid config key.');
}
$keys = explode('.', $key);
while (count($keys) > 1) {
$key = array_shift($keys);
if (!isset($this->config[$key]) || !is_array($this->config[$key])) {
$this->config[$key] = [];
}
$this->config =& $this->config[$key];
}
$this->config[array_shift($keys)] = $value;
return $this->config;
}