Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Console] Commands with an alias should not be recognized as ambiguous#25407
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
| $exact =in_array($name,$commands,true); | ||
| if (count($commands) >1 && !$exact) { | ||
| if (count($commands) >1 && !$exact && !isset($aliases[$name])) { |
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.
Maybe move the isset to the beginning as it's faster then count? - Micro optimization.
1f1e54c tocb9f6ffCompare| $exact =in_array($name,$commands,true); | ||
| if (count($commands) >1 && !$exact) { | ||
| if (!isset($aliases[$name]) &&count($commands) >1 && !$exact) { |
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.
changing line 537 to$exact = \in_array($name, $commands, true) || isset($aliases[$name]); would avoid the need for both this check and the condition added below
SimperfitDec 16, 2017 • 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.
it's better ike this ;). Thanks!
cb9f6ff to863f632Comparechalasr commentedDec 22, 2017
Thank you@Simperfit. |
…as ambiguous (Simperfit)This PR was merged into the 2.7 branch.Discussion----------[Console] Commands with an alias should not be recognized as ambiguous| Q | A| ------------- | ---| Branch? | 2.7| Bug fix? | yes| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->| BC breaks? | no| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->| Tests pass? | no| Fixed tickets | no <!-- #-prefixed issue number(s), if any -->| License | MIT| Doc PR |When having two commands with the same starting name and an alias equal to the starting name, we should not have an ambiguous error because we are setting the alias.Commits-------863f632 [Console] Commands with an alias should not be recognized as ambiguous
When having two commands with the same starting name and an alias equal to the starting name, we should not have an ambiguous error because we are setting the alias.