public function set($key, $value)
    {
        if (isset(self::$compositeKeys[$key])) {
            $this->assertArray($key, $value);
            $this->removeByKeyPrefix($key.'.');

            foreach ($value as $k => $v) {
                $this->set($key.'.'.$k, $v);
            }

            return;
        }

        if (!isset(self::$keys[$key])) {
            throw NoSuchConfigKeyException::forKey($key);
        }

        $this->validate($key, $value);

        $this->values[$key] = $value;
    }