Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[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

Merged
merged 1 commit into from
Feb 12, 2016
Merged

[FrameworkBundle] Improve debug:container command #17726

merged 1 commit into from
Feb 12, 2016

Conversation

voronkovich
Copy link
Contributor

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.

return $io->choice('Select one of the following services to display its information', $matchingServices);
if (1 === count($matchingServices)) {
return $matchingServices[0];
} else {
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stloyd, fixed! Thanks!

@xabbuh
Copy link
Member

xabbuh commented Feb 8, 2016

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.

@voronkovich
Copy link
Contributor Author

@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);

@xabbuh
Copy link
Member

xabbuh commented Feb 8, 2016

@voronkovich sounds better

@voronkovich voronkovich changed the title [FrameworkBundle] debug:container - Don't output choices when only one service found [FrameworkBundle] Improve debug:container command Feb 9, 2016
@voronkovich
Copy link
Contributor Author

@xabbuh, I've changed the command behavior as I proposed below.

@javiereguiluz
Copy link
Member

👍
Status: reviewed

@fabpot
Copy link
Member

fabpot commented Feb 12, 2016

Thank you @voronkovich.

@fabpot fabpot merged commit 3c6043e into symfony:master Feb 12, 2016
fabpot added a commit that referenced this pull request Feb 12, 2016
…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
@voronkovich voronkovich deleted the improve_debug-service_command branch February 12, 2016 16:19
@fabpot fabpot mentioned this pull request May 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants