|
@@ 505-507 (lines=3) @@
|
| 502 |
|
} |
| 503 |
|
|
| 504 |
|
$exact = in_array($namespace, $namespaces, true); |
| 505 |
|
if (count($namespaces) > 1 && !$exact) { |
| 506 |
|
throw new \InvalidArgumentException(sprintf('The namespace "%s" is ambiguous (%s).', $namespace, $this->getAbbreviationSuggestions(array_values($namespaces)))); |
| 507 |
|
} |
| 508 |
|
|
| 509 |
|
return $exact ? $namespace : reset($namespaces); |
| 510 |
|
} |
|
@@ 563-567 (lines=5) @@
|
| 560 |
|
} |
| 561 |
|
|
| 562 |
|
$exact = in_array($name, $commands, true); |
| 563 |
|
if (count($commands) > 1 && !$exact) { |
| 564 |
|
$suggestions = $this->getAbbreviationSuggestions(array_values($commands)); |
| 565 |
|
|
| 566 |
|
throw new \InvalidArgumentException(sprintf('Command "%s" is ambiguous (%s).', $name, $suggestions)); |
| 567 |
|
} |
| 568 |
|
|
| 569 |
|
return $this->get($exact ? $name : reset($commands)); |
| 570 |
|
} |