From 2ae0800cd31e1a0506d78ff8abe747df8d38f0fd Mon Sep 17 00:00:00 2001 From: SpacePossum Date: Fri, 16 Sep 2016 14:50:34 +0200 Subject: [PATCH] Remove useless concat. --- src/Composer/Autoload/AutoloadGenerator.php | 9 ++++++++- .../Test/Autoload/Fixtures/autoload_functions.php | 2 +- .../Fixtures/autoload_functions_by_dependency.php | 2 +- .../Test/Autoload/Fixtures/autoload_target_dir.php | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index 497df1e2a..2a66a4bf6 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -526,12 +526,19 @@ EOF; protected function getAutoloadFile($vendorPathToTargetDirCode, $suffix) { + $lastChar = $vendorPathToTargetDirCode[strlen($vendorPathToTargetDirCode)-1]; + if ("'" === $lastChar || '"' === $lastChar) { + $vendorPathToTargetDirCode = substr($vendorPathToTargetDirCode, 0, -1).'/autoload_real.php'.$lastChar; + } else { + $vendorPathToTargetDirCode .= " . '/autoload_real.php'"; + } + return <<