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

Skip to content

[Console] Fixed fatal error when the command is not defined #22144

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
Mar 25, 2017

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Mar 24, 2017

Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets https://github.com/symfony/symfony/pull/18140/files#r107871406
License MIT
Doc PR

@fabpot
Copy link
Member

fabpot commented Mar 24, 2017

@lyrixx Can you add a tests to avoid regressions?

@nicolas-grekas nicolas-grekas added this to the 3.3 milestone Mar 24, 2017
@wouterj
Copy link
Member

wouterj commented Mar 25, 2017

I think we should also trigger this event when CommandNotFound exceptions are thrown. What about allowing null for the command in ConsoleErrorEvent?

@chalasr
Copy link
Member

chalasr commented Mar 25, 2017

+1 for having the event fired on command not found. As there is currently no working case where the command is null I think it's safe to make it nullable in this specific event.

@fabpot
Copy link
Member

fabpot commented Mar 25, 2017

Thank you @lyrixx.

@fabpot fabpot merged commit d5b41b6 into symfony:master Mar 25, 2017
fabpot added a commit that referenced this pull request Mar 25, 2017
…d (lyrixx)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Fixed fatal error when the command is not defined

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/18140/files#r107871406
| License       | MIT
| Doc PR        |

Commits
-------

d5b41b6 [Console] Fixed fatal error when the command is not defined
@lyrixx lyrixx deleted the command-fix-fatal-error branch March 26, 2017 15:19
fabpot added a commit that referenced this pull request Apr 5, 2017
…lasr)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Allow to catch CommandNotFoundException

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #22144 (comment)
| License       | MIT
| Doc PR        | n/a

Basically reverts #22144, making the command argument optional in console.error event instead, so that `CommandNotFoundException` can be handled as any other console error.

Commits
-------

b21ce85 [Console] Allow to catch CommandNotFoundException
symfony-splitter pushed a commit to symfony/console that referenced this pull request Apr 5, 2017
…lasr)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Allow to catch CommandNotFoundException

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony/symfony#22144 (comment)
| License       | MIT
| Doc PR        | n/a

Basically reverts #22144, making the command argument optional in console.error event instead, so that `CommandNotFoundException` can be handled as any other console error.

Commits
-------

b21ce850e7 [Console] Allow to catch CommandNotFoundException
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants