Code Duplication    Length = 15-16 lines in 2 locations

packages/autoloader/src/AutoloadProcessor.php 2 locations

@@ 74-89 (lines=16) @@
71
72
		$processed = array();
73
74
		if ( $scanPsrPackages ) {
75
			foreach ( $autoloads['psr-4'] as $namespace => $sources ) {
76
				$namespace = empty( $namespace ) ? null : $namespace;
77
78
				foreach ( $sources as $source ) {
79
					$classmap = call_user_func( $this->classmapScanner, $source['path'], $excludedClasses, $namespace );
80
81
					foreach ( $classmap as $class => $path ) {
82
						$processed[ $class ] = array(
83
							'version' => $source['version'],
84
							'path'    => call_user_func( $this->pathCodeTransformer, $path ),
85
						);
86
					}
87
				}
88
			}
89
		}
90
91
		/*
92
		 * PSR-0 namespaces are converted to classmaps for both optimized and unoptimized autoloaders because any new
@@ 95-109 (lines=15) @@
92
		 * PSR-0 namespaces are converted to classmaps for both optimized and unoptimized autoloaders because any new
93
		 * development should use classmap or PSR-4 autoloading.
94
		 */
95
		if ( ! empty( $autoloads['psr-0'] ) ) {
96
			foreach ( $autoloads['psr-0'] as $namespace => $sources ) {
97
				$namespace = empty( $namespace ) ? null : $namespace;
98
99
				foreach ( $sources as $source ) {
100
					$classmap = call_user_func( $this->classmapScanner, $source['path'], $excludedClasses, $namespace );
101
					foreach ( $classmap as $class => $path ) {
102
						$processed[ $class ] = array(
103
							'version' => $source['version'],
104
							'path'    => call_user_func( $this->pathCodeTransformer, $path ),
105
						);
106
					}
107
				}
108
			}
109
		}
110
111
		if ( ! empty( $autoloads['classmap'] ) ) {
112
			foreach ( $autoloads['classmap'] as $package ) {