1
0
Fork 0

Better error reporting for incorrect repo specs

pull/5/head
Jordi Boggiano 2011-06-28 20:42:19 +02:00
parent f272f66324
commit 10486d8505
1 changed files with 2 additions and 2 deletions

View File

@ -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()