Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Conversation

@Simperfit
Copy link
Contributor

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?no
Fixed ticketsno
LicenseMIT
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.


$exact =in_array($name,$commands,true);
if (count($commands) >1 && !$exact) {
if (count($commands) >1 && !$exact && !isset($aliases[$name])) {
Copy link
Contributor

@sstoksstokDec 9, 2017
edited
Loading

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.

@chalasrchalasr added this to the2.7 milestoneDec 9, 2017
@SimperfitSimperfitforce-pushed thebugfix/console-commands-with-an-alias-should-no-be-ambiguous-when-not-using-register branch from1f1e54c tocb9f6ffCompareDecember 11, 2017 21:00

$exact =in_array($name,$commands,true);
if (count($commands) >1 && !$exact) {
if (!isset($aliases[$name]) &&count($commands) >1 && !$exact) {
Copy link
Member

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

Simperfit reacted with thumbs up emoji
Copy link
ContributorAuthor

@SimperfitSimperfitDec 16, 2017
edited
Loading

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!

@SimperfitSimperfitforce-pushed thebugfix/console-commands-with-an-alias-should-no-be-ambiguous-when-not-using-register branch fromcb9f6ff to863f632CompareDecember 16, 2017 04:47
@chalasr
Copy link
Member

Thank you@Simperfit.

@chalasrchalasr merged commit863f632 intosymfony:2.7Dec 22, 2017
chalasr pushed a commit that referenced this pull requestDec 22, 2017
…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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@sstoksstoksstok left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

2.7

Development

Successfully merging this pull request may close these issues.

5 participants

@Simperfit@chalasr@nicolas-grekas@sstok@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp