diff --git a/src/Composer/Package/Loader/ArrayLoader.php b/src/Composer/Package/Loader/ArrayLoader.php index 961544d23..4977763b8 100644 --- a/src/Composer/Package/Loader/ArrayLoader.php +++ b/src/Composer/Package/Loader/ArrayLoader.php @@ -55,10 +55,13 @@ class ArrayLoader if (isset($config['repositories'])) { $repositories = array(); - foreach ($config['repositories'] as $repo) { - if (!$repo) { + foreach ($config['repositories'] as $repoName => $repo) { + if (false === $repo && 'packagist' === $repoName) { continue; } + if (!is_array($repo)) { + throw new \UnexpectedValueException('Repository '.$repoName.' in '.$package->getPrettyName().' '.$package->getVersion().' should be an array, '.gettype($repo).' given'); + } $repository = $this->manager->createRepository(key($repo), current($repo)); $this->manager->addRepository($repository); }