public function create(Composer $composer): FileIteratorInterface
    {
        $config              = $composer->getConfig();
        $autoloadGenerator   = $composer->getAutoloadGenerator();
        $installationManager = $composer->getInstallationManager();
        $package             = $composer->getPackage();

        $autoloadGenerator->setClassMapAuthoritative(
            $config->get('classmap-authoritative')
        );
        $autoloadGenerator->setDevMode(false);

        $packageMap = $autoloadGenerator->buildPackageMap(
            $installationManager,
            $package,
            [$package]
        );

        $directives = $autoloadGenerator->parseAutoloads($packageMap, $package);

        $files = new AppendIterator();

        $files->append(
            $this->createClassmapIterator(
                $directives['classmap'] ?? [],
                $directives['exclude-from-classmap'] ?? []
            )
        );
        $files->append(
            $this->createFilesIterator(
                ...array_values($directives['files'] ?? [])
            )
        );
        $files->append(
            $this->createNamespaceIterator($directives['psr-0'] ?? [])
        );
        $files->append(
            $this->createNamespaceIterator($directives['psr-4'] ?? [])
        );

        return new FileIterator($files);
    }
public function create(Composer $composer): FileIteratorInterface
    {
        $config              = $composer->getConfig();
        $autoloadGenerator   = $composer->getAutoloadGenerator();
        $installationManager = $composer->getInstallationManager();
        $package             = $composer->getPackage();

        $autoloadGenerator->setClassMapAuthoritative(
            $config->get('classmap-authoritative')
        );
        $autoloadGenerator->setDevMode(false);

        $packageMap = $autoloadGenerator->buildPackageMap(
            $installationManager,
            $package,
            [$package]
        );

        $directives = $autoloadGenerator->parseAutoloads($packageMap, $package);

        $files = new AppendIterator();

        $files->append(
            $this->createClassmapIterator(
                $directives['classmap'] ?? [],
                $directives['exclude-from-classmap'] ?? []
            )
        );
        $files->append(
            $this->createFilesIterator(
                ...array_values($directives['files'] ?? [])
            )
        );
        $files->append(
            $this->createNamespaceIterator($directives['psr-0'] ?? [])
        );
        $files->append(
            $this->createNamespaceIterator($directives['psr-4'] ?? [])
        );

        return new FileIterator($files);
    }
public function create ( Composer $ composer ) : FileIteratorInterface { $ config = $ composer -> getConfig ( ) ; $ autoloadGenerator = $ composer -> getAutoloadGenerator ( ) ; $ installationManager = $ composer -> getInstallationManager ( ) ; $ package = $ composer -> getPackage ( ) ; $ autoloadGenerator -> setClassMapAuthoritative ( $ config -> get ( 'classmap-authoritative' ) ) ; $ autoloadGenerator -> setDevMode ( false ) ; $ packageMap = $ autoloadGenerator -> buildPackageMap ( $ installationManager , $ package , [ $ package ] ) ; $ directives = $ autoloadGenerator -> parseAutoloads ( $ packageMap , $ package ) ; $ files = new AppendIterator ( ) ; $ files -> append ( $ this -> createClassmapIterator ( $ directives [ 'classmap' ] ?? [ ] , $ directives [ 'exclude-from-classmap' ] ?? [ ] ) ) ; $ files -> append ( $ this -> createFilesIterator ( ... array_values ( $ directives [ 'files' ] ?? [ ] ) ) ) ; $ files -> append ( $ this -> createNamespaceIterator ( $ directives [ 'psr-0' ] ?? [ ] ) ) ; $ files -> append ( $ this -> createNamespaceIterator ( $ directives [ 'psr-4' ] ?? [ ] ) ) ; return new FileIterator ( $ files ) ; }
Get an iterable list of source files for the root package of the given
Composer instance.

@param Composer $composer

@return FileIteratorInterface
Get an iterable list of source files for the root package of the given Composer instance .