-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] remove debug dependency that was dead code #24961
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
[Console] remove debug dependency that was dead code #24961
Conversation
Tobion
commented
Nov 13, 2017
Q | A |
---|---|
Branch? | master |
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #24873 |
License | MIT |
Doc PR |
} catch (\Exception $x) { | ||
$e = $x; | ||
} catch (\Throwable $x) { | ||
$e = new FatalThrowableError($x); |
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 was effectively useless. below it was throwing the original exception ($x) in this case anyway, not $e. this could be removed in 2.7 as well. but there the debug component is still needed for the ConsoleExceptionEvent (instead of ConsoleErrorEvent). so the debug component dependency can only be removed in 4.0
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.
with 4.0 we can also get rid of handling both \Exception and \Throwable as it was already done in other places like doRun
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.
Created #24962 for 2.7
@@ -203,11 +195,12 @@ public function doRun(InputInterface $input, OutputInterface $output) | |||
if (null !== $this->dispatcher) { | |||
$event = new ConsoleErrorEvent($input, $output, $e); | |||
$this->dispatcher->dispatch(ConsoleEvents::ERROR, $event); | |||
$e = $event->getError(); |
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.
just some micro optim to not call the method when not needed (same as below)
@@ -851,7 +844,6 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI | |||
} | |||
|
|||
$event = new ConsoleCommandEvent($command, $input, $output); | |||
$e = null; |
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.
unused fragment from 3.x
This PR was merged into the 2.7 branch. Discussion ---------- [Console] remove dead code | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | 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? | yes | Fixed tickets | | License | MIT | Doc PR | Part of #24961 for 2.7 Commits ------- 65f2b13 [Console] remove dead code
@Tobion could you resolve this PR merge conflicts? |
c9a387c
to
453e799
Compare
rebased |
…bion) This PR was merged into the 4.0-dev branch. Discussion ---------- [Console] remove debug dependency that was dead code | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24873 | License | MIT | Doc PR | Commits ------- 453e799 [Console] remove debug dependency that was dead code
…ode (Tobion) This PR was merged into the 4.0-dev branch. Discussion ---------- [Console] remove debug dependency that was dead code | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#24873 | License | MIT | Doc PR | Commits ------- 453e799 [Console] remove debug dependency that was dead code