WordPress at a glance
function is not described


AutoloadGenerator::processAutoloads() private WC 1.0

Given Composer's autoloads this will convert them to a version that we can use to generate the manifests.

When the $scanPsrPackages argument is true, PSR-4 namespaces are converted to classmaps. When $scanPsrPackages is false, PSR-4 namespaces are not converted to classmaps.

PSR-0 namespaces are always converted to classmaps.

{} It's a method of the class: AutoloadGenerator{}

No Hooks.


Array. $processedAutoloads


// private - for code of main (parent) class only
$result = $this->processAutoloads( $autoloads, $scanPsrPackages, $vendorPath, $basePath );
$autoloads(array) (required)
The autoloads we want to process.
$scanPsrPackages(true|false) (required)
Whether or not PSR-4 packages should be converted to a classmap.
$vendorPath(string) (required)
The path to the vendor directory.
$basePath(string) (required)
The path to the current directory.

Code of AutoloadGenerator::processAutoloads() WC 5.3.0

private function processAutoloads( $autoloads, $scanPsrPackages, $vendorPath, $basePath ) {
	$processor = new AutoloadProcessor(
		function ( $path, $excludedClasses, $namespace ) use ( $basePath ) {
			$dir = $this->filesystem->normalizePath(
				$this->filesystem->isAbsolutePath( $path ) ? $path : $basePath . '/' . $path
			return ClassMapGenerator::createMap(
				null, // Don't pass the IOInterface since the normal autoload generation will have reported already.
				empty( $namespace ) ? null : $namespace
		function ( $path ) use ( $basePath, $vendorPath ) {
			return $this->getPathCode( $this->filesystem, $basePath, $vendorPath, $path );

	return array(
		'psr-4'    => $processor->processPsr4Packages( $autoloads, $scanPsrPackages ),
		'classmap' => $processor->processClassmap( $autoloads, $scanPsrPackages ),
		'files'    => $processor->processFiles( $autoloads ),