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