1
0
Fork 0

Stricter validation for the repositories config

pull/33/merge
Jordi Boggiano 2011-11-03 19:32:28 +01:00
parent 066a0db752
commit 1844940a39
1 changed files with 5 additions and 2 deletions

View File

@ -55,10 +55,13 @@ class ArrayLoader
if (isset($config['repositories'])) { if (isset($config['repositories'])) {
$repositories = array(); $repositories = array();
foreach ($config['repositories'] as $repo) { foreach ($config['repositories'] as $repoName => $repo) {
if (!$repo) { if (false === $repo && 'packagist' === $repoName) {
continue; 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)); $repository = $this->manager->createRepository(key($repo), current($repo));
$this->manager->addRepository($repository); $this->manager->addRepository($repository);
} }