Stricter validation for the repositories config
parent
066a0db752
commit
1844940a39
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue