public function set($key, $value = null)
    {
        if (is_array($key)) {
            return $this->merge($key);
        }

        if (func_num_args() < 2) {
            throw new \ArgumentCountError("To few arguments passed to Config::set(). Expected 2 got 1");
        }

        $conf =& $this->conf;

        $segments = explode('.', $key);

        while (count($segments) > 1) {
            $segment = array_shift($segments);
            if (!isset($conf[$segment]) || !is_array($conf[$segment])) {
                $conf[$segment] = [];
            }
            $conf =& $conf[$segment];
        }

        return $conf[array_shift($segments)] = $value;
    }
public function set($key, $value = null)
    {
        if (is_array($key)) {
            return $this->merge($key);
        }

        if (func_num_args() < 2) {
            throw new \ArgumentCountError("To few arguments passed to Config::set(). Expected 2 got 1");
        }

        $conf =& $this->conf;

        $segments = explode('.', $key);

        while (count($segments) > 1) {
            $segment = array_shift($segments);
            if (!isset($conf[$segment]) || !is_array($conf[$segment])) {
                $conf[$segment] = [];
            }
            $conf =& $conf[$segment];
        }

        return $conf[array_shift($segments)] = $value;
    }
{@inheritdoc}