From 10486d850509487f4b825a566a5f7c794459d84a Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 28 Jun 2011 20:42:19 +0200 Subject: [PATCH] Better error reporting for incorrect repo specs --- src/Composer/Composer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Composer.php b/src/Composer/Composer.php index 1338f9e2e..fb487d218 100644 --- a/src/Composer/Composer.php +++ b/src/Composer/Composer.php @@ -63,10 +63,10 @@ class Composer if (null === $spec) { 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)); } - 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()