Skip to content

[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

Merged
merged 1 commit into from
Nov 17, 2017

Conversation

Tobion
Copy link
Contributor

@Tobion 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);
Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor Author

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();
Copy link
Contributor Author

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;
Copy link
Contributor Author

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

chalasr added a commit that referenced this pull request Nov 15, 2017
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
@sroze
Copy link
Contributor

sroze commented Nov 17, 2017

@Tobion could you resolve this PR merge conflicts?

@Tobion Tobion force-pushed the unused-debug-component-in-console branch from c9a387c to 453e799 Compare November 17, 2017 15:43
@Tobion
Copy link
Contributor Author

Tobion commented Nov 17, 2017

rebased

@Tobion Tobion merged commit 453e799 into symfony:master Nov 17, 2017
Tobion added a commit that referenced this pull request Nov 17, 2017
…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
@Tobion Tobion deleted the unused-debug-component-in-console branch November 17, 2017 15:56
Simperfit pushed a commit to Simperfit/symfony that referenced this pull request Nov 18, 2017
…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
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.

5 participants