public function addDirectory($directory)
    {
        if (!file_exists($directory) || !is_dir($directory)) {
            throw new \Exception('The configuration directory does not exist.');
        } else {
            if (substr($directory, -1) != DIRECTORY_SEPARATOR) {
                $directory .= DIRECTORY_SEPARATOR;
            }

            foreach (glob($directory . '*.yml') as $file) {
                self::addFile($file);
            }
        }

        return self::getInstance();
    }