Explorar o código

Improve message some more, refs #3655

Jordi Boggiano %!s(int64=10) %!d(string=hai) anos
pai
achega
c8011af219
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/Composer/Factory.php

+ 3 - 0
src/Composer/Factory.php

@@ -166,6 +166,9 @@ class Factory
         }
 
         foreach ($config->getRepositories() as $index => $repo) {
+            if (is_string($repo)) {
+                throw new \UnexpectedValueException('Repositories should be an array of repository defintions, only a single repository was given');
+            }
             if (!is_array($repo)) {
                 throw new \UnexpectedValueException('Repository "'.$index.'" ('.json_encode($repo).') should be an array, '.gettype($repo).' given');
             }