-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] fixed PHP7 Errors when not using Dispatcher #20736
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
Conversation
@@ -159,6 +159,8 @@ public function run(InputInterface $input = null, OutputInterface $output = null | |||
* @param OutputInterface $output An Output instance | |||
* | |||
* @return int 0 if everything went fine, or an error code | |||
* | |||
* @throws \Exception propagate the exception from `doRunCommand` |
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.
this is current behaviour, just documenting it as doRunCommand
is protected, so it's not part of public interface, which should be documented anyway...
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.
This can be removed as it does not bring any useful information (\Exception can be anything, we only document exceptions when we give an explanation about when a specific exception can occur).
} catch (\Exception $e) { | ||
throw $e; | ||
} | ||
catch (\Throwable $e) { |
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.
extra newline
👍 |
@@ -159,6 +159,8 @@ public function run(InputInterface $input = null, OutputInterface $output = null | |||
* @param OutputInterface $output An Output instance | |||
* | |||
* @return int 0 if everything went fine, or an error code | |||
* | |||
* @throws \Exception when the command being run threw an exception |
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.
I still think this should be removed as this is not actionnable.
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.
very well.
btw, please check an email
Thank you @keradus. |
…adus) This PR was squashed before being merged into the 2.7 branch (closes #20736). Discussion ---------- [Console] fixed PHP7 Errors when not using Dispatcher | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #17257, #20110, #20111 | License | MIT | Doc PR | n/a Original fix, #19813, works only when there is event dispatcher available. This PR fix the issue also for scenario without event dispatcher. Closes #20110 issue and #20111 PR connected to it. Closing #17257 , as everywhere the error is converted to exception and it should be handled Commits ------- 899fa79 [Console] fixed PHP7 Errors when not using Dispatcher
Unless I'm misunderstanding something, I think this should be reverted accordingly to #19813 (comment). The behavior is inconsistent depending on whether an event dispatcher is injected or not. When it's injected, the original See #20917 (comment) for more details. |
Original fix, #19813, works only when there is event dispatcher available.
This PR fix the issue also for scenario without event dispatcher.
Closes #20110 issue and #20111 PR connected to it.
Closing #17257 , as everywhere the error is converted to exception and it should be handled