Code Duplication    Length = 12-12 lines in 3 locations

packages/autoloader/src/AutoloadGenerator.php 3 locations

@@ 201-212 (lines=12) @@
198
				$namespace = empty( $namespace ) ? null : $namespace;
199
				$map       = ClassMapGenerator::createMap( $dir, $blacklist, $this->io, $namespace );
200
201
				foreach ( $map as $class => $path ) {
202
					$classCode       = var_export( $class, true );
203
					$pathCode        = $this->getPathCode( $filesystem, $basePath, $vendorPath, $path );
204
					$versionCode     = var_export( $package['version'], true );
205
					$classmapString .= <<<CLASS_CODE
206
	$classCode => array(
207
		'version' => $versionCode,
208
		'path'    => $pathCode
209
	),
210
CLASS_CODE;
211
					$classmapString .= PHP_EOL;
212
				}
213
			}
214
		}
215
@@ 224-235 (lines=12) @@
221
			);
222
			$map = ClassMapGenerator::createMap( $dir, $blacklist, $this->io, null );
223
224
			foreach ( $map as $class => $path ) {
225
				$classCode       = var_export( $class, true );
226
				$pathCode        = $this->getPathCode( $filesystem, $basePath, $vendorPath, $path );
227
				$versionCode     = var_export( $package['version'], true );
228
				$classmapString .= <<<CLASS_CODE
229
	$classCode => array(
230
		'version' => $versionCode,
231
		'path'    => $pathCode
232
	),
233
CLASS_CODE;
234
				$classmapString .= PHP_EOL;
235
			}
236
		}
237
238
		return 'array( ' . PHP_EOL . $classmapString . ');' . PHP_EOL;
@@ 275-286 (lines=12) @@
272
	 */
273
	private function getFileMap( array $autoloads, Filesystem $filesystem, $vendorPath, $basePath ) {
274
		$fileMapString = '';
275
		foreach ( $autoloads['files'] as $file_id => $package ) {
276
			$key            = var_export( $file_id, true );
277
			$pathCode       = $this->getPathCode( $filesystem, $basePath, $vendorPath, $package['path'] );
278
			$versionCode    = var_export( $package['version'], true );
279
			$fileMapString .= <<<FILE_CODE
280
	$key => array(
281
		'version' => $versionCode,
282
		'path'    => $pathCode
283
	),
284
FILE_CODE;
285
			$fileMapString .= PHP_EOL;
286
		}
287
288
		return 'array( ' . PHP_EOL . $fileMapString . ');' . PHP_EOL;
289
	}