private function getFilesForPackage(PackageInterface $package)
    {
        if ($package instanceof RootPackageInterface) {
            $path = '.';
        } else {
            $path = $this->composer->getInstallationManager()->getInstallPath($package);
        }

        $path  .= '/src';
        $finder = new Finder();

        return $finder
            ->ignoreVCS(true)
            ->ignoreDotFiles(true)
            ->exclude(['Generated'])
            ->name('*.php')
            ->in($path)
            ->getIterator();
    }