Code Duplication    Length = 12-12 lines in 3 locations

packages/autoloader/src/AutoloadGenerator.php 3 locations

@@ 226-237 (lines=12) @@
223
				$namespace = empty( $namespace ) ? null : $namespace;
224
				$map       = ClassMapGenerator::createMap( $dir, $blacklist, $this->io, $namespace );
225
226
				foreach ( $map as $class => $path ) {
227
					$classCode       = var_export( $class, true );
228
					$pathCode        = $this->getPathCode( $filesystem, $basePath, $vendorPath, $path );
229
					$versionCode     = var_export( $package['version'], true );
230
					$classmapString .= <<<CLASS_CODE
231
	$classCode => array(
232
		'version' => $versionCode,
233
		'path'    => $pathCode
234
	),
235
CLASS_CODE;
236
					$classmapString .= PHP_EOL;
237
				}
238
			}
239
		}
240
@@ 249-260 (lines=12) @@
246
			);
247
			$map = ClassMapGenerator::createMap( $dir, $blacklist, $this->io, null );
248
249
			foreach ( $map as $class => $path ) {
250
				$classCode       = var_export( $class, true );
251
				$pathCode        = $this->getPathCode( $filesystem, $basePath, $vendorPath, $path );
252
				$versionCode     = var_export( $package['version'], true );
253
				$classmapString .= <<<CLASS_CODE
254
	$classCode => array(
255
		'version' => $versionCode,
256
		'path'    => $pathCode
257
	),
258
CLASS_CODE;
259
				$classmapString .= PHP_EOL;
260
			}
261
		}
262
263
		return 'array( ' . PHP_EOL . $classmapString . ');' . PHP_EOL;
@@ 300-311 (lines=12) @@
297
	 */
298
	private function getFileMap( array $autoloads, Filesystem $filesystem, $vendorPath, $basePath ) {
299
		$fileMapString = '';
300
		foreach ( $autoloads['files'] as $file_id => $package ) {
301
			$key            = var_export( $file_id, true );
302
			$pathCode       = $this->getPathCode( $filesystem, $basePath, $vendorPath, $package['path'] );
303
			$versionCode    = var_export( $package['version'], true );
304
			$fileMapString .= <<<FILE_CODE
305
	$key => array(
306
		'version' => $versionCode,
307
		'path'    => $pathCode
308
	),
309
FILE_CODE;
310
			$fileMapString .= PHP_EOL;
311
		}
312
313
		return 'array( ' . PHP_EOL . $fileMapString . ');' . PHP_EOL;
314
	}