Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Command] Add question helper for unknown or ambiguous commands#19282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
hason commentedJul 4, 2016
| Q | A |
|---|---|
| Branch? | master |
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | #16261 |
| License | MIT |
| Doc PR |

fabpot commentedJul 4, 2016
Without looking at the code, I cannot understand the difference between |
| public function __construct($namespace, $alternatives = array(), $code = null, $previous = null) | ||
| { | ||
| $this->command = $namespace; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
typo$this->namespace = $namespace;
chalasr commentedJul 11, 2016
👍 It would be nice to have this. IMO having several exception classes could be avoided here. Adding an utility method to the CommandNotFoundException that formats the message based on alternatives (i.e. "Did you mean...") should be enough. |
| if ($alternatives) { | ||
| if (1 == count($alternatives)) { | ||
| $message .= "\n\nDid you mean this?\n "; |
ogizanagiJul 11, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I doubt the exception should format the message rendered in the console itself. Instead, consumers should build the formatted message IMO.
fabpot commentedMar 22, 2017
@hason Can you take comments into account and rebase? Thanks. |
fabpot commentedJul 6, 2017
Closing as there is no feedback. Feel free to reopen whenever it is ready. |