1
0
Fork 0

Improve error message for case with incorrect "repositories"

pull/3656/head
Dmitry Tarasov 2015-01-20 13:44:29 +03:00
parent 3b678ee379
commit f50cfe6d45
1 changed files with 2 additions and 2 deletions

View File

@ -167,10 +167,10 @@ class Factory
foreach ($config->getRepositories() as $index => $repo) { foreach ($config->getRepositories() as $index => $repo) {
if (!is_array($repo)) { if (!is_array($repo)) {
throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') should be an array, '.gettype($repo).' given'); throw new \UnexpectedValueException('Repository "'.$index.'" ('.json_encode($repo).') should be an array, '.gettype($repo).' given');
} }
if (!isset($repo['type'])) { if (!isset($repo['type'])) {
throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a type defined'); throw new \UnexpectedValueException('Repository "'.$index.'" ('.json_encode($repo).') must have a type defined');
} }
$name = is_int($index) && isset($repo['url']) ? preg_replace('{^https?://}i', '', $repo['url']) : $index; $name = is_int($index) && isset($repo['url']) ? preg_replace('{^https?://}i', '', $repo['url']) : $index;
while (isset($repos[$name])) { while (isset($repos[$name])) {