diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index d5cae8428..103ed9189 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -14,6 +14,7 @@ namespace Composer\Autoload; use Composer\Installer\InstallationManager; use Composer\Json\JsonFile; +use Composer\Package\AliasPackage; use Composer\Package\Loader\JsonLoader; use Composer\Package\PackageInterface; use Composer\Repository\RepositoryInterface; @@ -153,6 +154,9 @@ EOF; $packageMap[] = array($mainPackage, ''); foreach ($packages as $package) { + if ($package instanceof AliasPackage) { + continue; + } $packageMap[] = array( $package, $installationManager->getInstallPath($package) diff --git a/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php b/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php index b9974fd9b..7ecdec38e 100644 --- a/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php +++ b/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php @@ -14,6 +14,7 @@ namespace Composer\Test\Autoload; use Composer\Autoload\AutoloadGenerator; use Composer\Util\Filesystem; +use Composer\Package\AliasPackage; use Composer\Package\MemoryPackage; use Composer\Test\TestCase; @@ -164,6 +165,7 @@ class AutoloadGeneratorTest extends TestCase $packages = array(); $packages[] = $a = new MemoryPackage('a/a', '1.0', '1.0'); $packages[] = $b = new MemoryPackage('b/b', '1.0', '1.0'); + $packages[] = $c = new AliasPackage($b, '1.2', '1.2'); $a->setAutoload(array('psr-0' => array('A' => 'src/', 'A\\B' => 'lib/'))); $b->setAutoload(array('psr-0' => array('B\\Sub\\Name' => 'src/')));