diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index bc54f495d..95f5256dc 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -343,7 +343,7 @@ AUTOLOAD; // - https://bugs.php.net/bug.php?id=59298 if ($filesCode) { - $filesCode = "\n".$filesCode; + $filesCode = "\n\n".rtrim($filesCode); } $file = <<
register(); -$filesCode + \$loader->register();{$filesCode} return \$loader; } diff --git a/tests/Composer/Test/Autoload/Fixtures/php5.4/traits.php b/tests/Composer/Test/Autoload/Fixtures/php5.4/traits.php index 34257c712..2d92c378e 100644 --- a/tests/Composer/Test/Autoload/Fixtures/php5.4/traits.php +++ b/tests/Composer/Test/Autoload/Fixtures/php5.4/traits.php @@ -1,7 +1,7 @@