private function loadConfig(string $config) : void
    {
        if (!file_exists($config)) {
            throw new NotfoundException;
        }
        $ext = substr($config, strrpos($config, '.') + 1);
        switch ($ext) {
            case 'json':
                $settings = json_decode(file_get_contents($config), true);
                if (is_null($settings)) {
                    throw new InvalidException;
                }
                break;
            case 'yml':
            case 'yaml':
                try {
                    $settings = Yaml::parse(file_get_contents($config));
                } catch (\Exception $e) {
                    throw new InvalidException;
                }
                break;
            case 'ini':
                $settings = parse_ini_file($config, true);
                if ($settings === false) {
                    throw new InvalidException;
                }
                break;
            case 'xml':
                $xml = simplexml_load_file($config);
                if ($xml === false) {
                    throw new InvalidException;
                }
                $settings = json_decode(json_encode($xml), true);
                break;
            case 'php':
                $settings = include $config;
                if (!is_array($settings)) {
                    throw new InvalidException;
                }
                break;
            default:
                throw new UnknownFormatException;
        }
        $new = (array)$this + $settings;
        foreach ($new as $key => $value) {
            $this[$key] = $value;
        }            
    }