Преглед на файлове

Slightly nicer heredoc in AutoloadGenerator::getIncludePathsFile()

Andreas Hennings преди 11 години
родител
ревизия
ce8a9aae5b
променени са 1 файла, в които са добавени 7 реда и са изтрити 7 реда
  1. 7 7
      src/Composer/Autoload/AutoloadGenerator.php

+ 7 - 7
src/Composer/Autoload/AutoloadGenerator.php

@@ -276,7 +276,12 @@ EOF;
             return;
         }
 
-        $includePathsFile = <<<EOF
+        $includePathsCode = '';
+        foreach ($includePaths as $path) {
+            $includePathsCode .= "    " . $this->getPathCode($filesystem, $basePath, $vendorPath, $path) . ",\n";
+        }
+
+        return <<<EOF
 <?php
 
 // include_paths.php generated by Composer
@@ -285,14 +290,9 @@ EOF;
 \$baseDir = $appBaseDirCode;
 
 return array(
+$includePathsCode);
 
 EOF;
-
-        foreach ($includePaths as $path) {
-            $includePathsFile .= "    " . $this->getPathCode($filesystem, $basePath, $vendorPath, $path) . ",\n";
-        }
-
-        return $includePathsFile . ");\n";
     }
 
     protected function getIncludeFilesFile(array $files, Filesystem $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode)