public function addDirectory($path, $recursive = true)
    {
        if (realpath($path) === false || !is_dir(realpath($path))) {
            throw new FileNotFoundException(sprintf("Directory '%s' not found.", $path));
        }

        $finder = new Finder();
        $finder->files()->name('*.yml')->depth($recursive ? '>= 0' : '== 0')->in($path)->sortByName();
        foreach ($finder as $file) {
            /** @var \SplFileInfo $file */
            $this->addFile($file->getRealpath());
        }

        return $this;
    }