Code Duplication    Length = 12-12 lines in 2 locations

packages/autoloader/src/AutoloadGenerator.php 2 locations

@@ 125-136 (lines=12) @@
122
				$installPath = substr( $installPath, 0, -strlen( '/' . $package->getTargetDir() ) );
123
			}
124
125
			if ( 'psr-4' === $type && isset( $autoload['psr-4'] ) && is_array( $autoload['psr-4'] ) ) {
126
				foreach ( $autoload['psr-4'] as $namespace => $paths ) {
127
					$paths = is_array( $paths ) ? $paths : array( $paths );
128
					foreach ( $paths as $path ) {
129
						$relativePath              = empty( $installPath ) ? ( empty( $path ) ? '.' : $path ) : $installPath . '/' . $path;
130
						$autoloads[ $namespace ][] = array(
131
							'path'    => $relativePath,
132
							'version' => $package->getVersion(), // Version of the class comes from the package - should we try to parse it?
133
						);
134
					}
135
				}
136
			}
137
138
			if ( 'classmap' === $type && isset( $autoload['classmap'] ) && is_array( $autoload['classmap'] ) ) {
139
				foreach ( $autoload['classmap'] as $paths ) {
@@ 138-149 (lines=12) @@
135
				}
136
			}
137
138
			if ( 'classmap' === $type && isset( $autoload['classmap'] ) && is_array( $autoload['classmap'] ) ) {
139
				foreach ( $autoload['classmap'] as $paths ) {
140
					$paths = is_array( $paths ) ? $paths : array( $paths );
141
					foreach ( $paths as $path ) {
142
						$relativePath = empty( $installPath ) ? ( empty( $path ) ? '.' : $path ) : $installPath . '/' . $path;
143
						$autoloads[]  = array(
144
							'path'    => $relativePath,
145
							'version' => $package->getVersion(), // Version of the class comes from the package - should we try to parse it?
146
						);
147
					}
148
				}
149
			}
150
		}
151
152
		return $autoloads;