Explorar o código

Fix parse error thrown in PHP5.5+

When running composer update the file generated by AutoloadGenerator was
not able to be parsed by php due to a require statement inside the foreach
loop.

The fix is to make the statement work the same as the
autoload_namespaces.php require is done.

Issue occured using the following php versions

PHP 5.5.1-2+debphp.org~precise+2
PHP 5.5.3-1+debphp.org~precise+2
Alan Hollis %!s(int64=11) %!d(string=hai) anos
pai
achega
ede2b37ae2
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      src/Composer/Autoload/AutoloadGenerator.php

+ 4 - 3
src/Composer/Autoload/AutoloadGenerator.php

@@ -460,9 +460,10 @@ REGISTER_AUTOLOAD;
 REGISTER_LOADER;
 
         if ($useIncludeFiles) {
-            $file .= <<<INCLUDE_FILES
-        foreach (require __DIR__ . '/autoload_files.php' as \$file) {
-            require \$file;
+            $file .= <<<'INCLUDE_FILES'
+        $includeFiles = require __DIR__ . '/autoload_files.php';
+        foreach ($includeFiles as $file) {
+            require $file;
         }