You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (class_exists($fqcn = $namespace.'\\'.$shortClassName)) {
164
-
$this->typesFound[] = $fqcn;
157
+
$classes[] = $fqcn;
165
158
}
166
159
}
167
160
168
-
if (0 === count($this->typesFound)) {
169
-
thrownew \InvalidArgumentException(sprintf('Could not find type "%s" into the following namespaces: %s.', $shortClassName, implode(', ', $this->namespaces)));
161
+
if (0 === $count = count($classes)) {
162
+
thrownew \InvalidArgumentException(sprintf("Could not find type \"%s\" into the following namespaces:\n %s", $shortClassName, implode("\n", $this->namespaces)));
163
+
}
164
+
if (1 === $count) {
165
+
return$classes[0];
166
+
}
167
+
if (!$input->isInteractive()) {
168
+
thrownew \InvalidArgumentException(sprintf("The type \"%s\" is ambiguous.\nDid you mean one of these?\n %s", $shortClassName, implode("\n", $classes)));
170
169
}
171
170
172
-
return$this->typesFound[0];
171
+
return$io->choice(sprintf("The type \"%s\" is ambiguous.\n\n Select one of the following form types to display its information:", $shortClassName), $classes, $classes[0]);
0 commit comments