Code Duplication    Length = 12-12 lines in 3 locations

packages/autoloader/src/AutoloadGenerator.php 3 locations

@@ 231-242 (lines=12) @@
228
				$namespace = empty( $namespace ) ? null : $namespace;
229
				$map       = ClassMapGenerator::createMap( $dir, $blacklist, $this->io, $namespace );
230
231
				foreach ( $map as $class => $path ) {
232
					$classCode       = var_export( $class, true );
233
					$pathCode        = $this->getPathCode( $filesystem, $basePath, $vendorPath, $path );
234
					$versionCode     = var_export( $package['version'], true );
235
					$classmapString .= <<<CLASS_CODE
236
	$classCode => array(
237
		'version' => $versionCode,
238
		'path'    => $pathCode
239
	),
240
CLASS_CODE;
241
					$classmapString .= PHP_EOL;
242
				}
243
			}
244
		}
245
@@ 254-265 (lines=12) @@
251
			);
252
			$map = ClassMapGenerator::createMap( $dir, $blacklist, $this->io, null );
253
254
			foreach ( $map as $class => $path ) {
255
				$classCode       = var_export( $class, true );
256
				$pathCode        = $this->getPathCode( $filesystem, $basePath, $vendorPath, $path );
257
				$versionCode     = var_export( $package['version'], true );
258
				$classmapString .= <<<CLASS_CODE
259
	$classCode => array(
260
		'version' => $versionCode,
261
		'path'    => $pathCode
262
	),
263
CLASS_CODE;
264
				$classmapString .= PHP_EOL;
265
			}
266
		}
267
268
		return 'array( ' . PHP_EOL . $classmapString . ');' . PHP_EOL;
@@ 305-316 (lines=12) @@
302
	 */
303
	private function getFileMap( array $autoloads, Filesystem $filesystem, $vendorPath, $basePath ) {
304
		$fileMapString = '';
305
		foreach ( $autoloads['files'] as $file_id => $package ) {
306
			$key            = var_export( $file_id, true );
307
			$pathCode       = $this->getPathCode( $filesystem, $basePath, $vendorPath, $package['path'] );
308
			$versionCode    = var_export( $package['version'], true );
309
			$fileMapString .= <<<FILE_CODE
310
	$key => array(
311
		'version' => $versionCode,
312
		'path'    => $pathCode
313
	),
314
FILE_CODE;
315
			$fileMapString .= PHP_EOL;
316
		}
317
318
		return 'array( ' . PHP_EOL . $fileMapString . ');' . PHP_EOL;
319
	}