/**
  * @param string $composerAutoloader
  * @return array
  */
 public function generateAutoloader($composerAutoloader)
 {
     $projectAutoloaderTemplate = file_get_contents(__DIR__ . "/templates/project_autoloader.txt");
     $projectAutoloader = str_replace('%file', 'composer/project/' . ProjectAutoloaderFileMapper::getFilename('main'), $projectAutoloaderTemplate);
     $autoloaderContent = $this->getComposerAutoloaderContent($composerAutoloader);
     return preg_replace('/return (.*)/', '$composer = $1' . $projectAutoloader, $autoloaderContent, 1);
 }
 private function generateMainAutoloader($autoloaders)
 {
     $autoloaderTemplate = file_get_contents(__DIR__ . "/templates/autoload.txt");
     $itemTemplate = file_get_contents(__DIR__ . "/templates/autoload_item.txt");
     $autoloaderString = '';
     foreach ($autoloaders as $type => $autoloader) {
         $filename = ProjectAutoloaderFileMapper::getFilename($type);
         $autoloaderString .= str_replace('%file', $filename, $itemTemplate);
     }
     $autoloader = str_replace('%array', $autoloaderString, $autoloaderTemplate);
     return $autoloader;
 }