-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Improve debug:container command #17726
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FrameworkBundle] Improve debug:container command #17726
Conversation
return $io->choice('Select one of the following services to display its information', $matchingServices); | ||
if (1 === count($matchingServices)) { | ||
return $matchingServices[0]; | ||
} else { |
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.
else
can be removed as you call return
in if
.
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.
@stloyd, fixed! Thanks!
I don't think that it is a good idea to automatically display the information for the first service that looks similar as you won't notice that you made a mistake. |
@xabbuh, what about to use the default value? $default = 1 === count($matchingServices) ? 0 : null;
return $io->choice('Select one of the following services to display its information', $matchingServices, $default); |
@voronkovich sounds better |
@xabbuh, I've changed the command behavior as I proposed below. |
👍 |
Thank you @voronkovich. |
…onkovich) This PR was merged into the 3.1-dev branch. Discussion ---------- [FrameworkBundle] Improve debug:container command | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT | When the only one service found we could set it as a default value, so user have to just press enter to see it's definition. Commits ------- 3c6043e Improve debug:container command
When the only one service found we could set it as a default value, so user have to just press enter to see it's definition.