public function build()
    {
        $pm = new PluginManager($this->eventDispatcher);
        $pluginCollection = $pm->getPluginCollection();

        if (file_exists($this->path) === false) {
            return $pm;
        }

        $classnamesFromComposerFile = [];

        $finder = $this->buildFinder();

        foreach ($finder as $file) {
            if ($file->getFilename() === $this->composerFilename) {
                $classes = $this->getClassnamesFromComposerFile($file);
                $classnamesFromComposerFile = array_merge($classnamesFromComposerFile, $classes);

                continue;
            }

            $classname = $this->getClassnameFromPHPFilename($file);

            include_once $file->getRealPath();

            if ($this->hasImplementedPluginInterface($classname) === false) {
                continue;
            }

            $this->addPluginToCollection($classname, $pluginCollection);
        }

        foreach ($classnamesFromComposerFile as $classname) {
            if ($this->hasImplementedPluginInterface($classname) === true) {
                $this->addPluginToCollection($classname, $pluginCollection);
            }
        }

        return $pm;
    }