src/Plugin.php
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();
    }
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();
    }
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 ( ) ; }
Find all the PHP files within a package.

Excludes
- all files in VCS directories
- all files in vendor folders
- all files in Generated folders
- all hidden files

@throws \LogicException
@throws \InvalidArgumentException

@param PackageInterface $package
@return \Iterator|\SplFileInfo[]
Find all the PHP files within a package .