Better error reporting for incorrect repo specs
parent
f272f66324
commit
10486d8505
|
@ -63,10 +63,10 @@ class Composer
|
||||||
if (null === $spec) {
|
if (null === $spec) {
|
||||||
unset($this->repositories[$name]);
|
unset($this->repositories[$name]);
|
||||||
}
|
}
|
||||||
if (is_array($spec) && count($spec)) {
|
if (is_array($spec) && count($spec) === 1) {
|
||||||
return $this->repositories[$name] = $this->createRepository($name, key($spec), current($spec));
|
return $this->repositories[$name] = $this->createRepository($name, key($spec), current($spec));
|
||||||
}
|
}
|
||||||
throw new \UnexpectedValueException('Invalid repositories specification '.var_export($spec, true));
|
throw new \UnexpectedValueException('Invalid repositories specification '.json_encode($spec).', should be: {"type": "url"}');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRepositories()
|
public function getRepositories()
|
||||||
|
|
Loading…
Reference in New Issue