Skip to content

Commit 8eb97f5

Browse files
committed
minor symfony#24961 [Console] remove debug dependency that was dead code (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
2 parents 3fc2d1c + 453e799 commit 8eb97f5

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

src/Symfony/Component/Console/Application.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
4040
use Symfony\Component\Console\Exception\CommandNotFoundException;
4141
use Symfony\Component\Console\Exception\LogicException;
42-
use Symfony\Component\Debug\Exception\FatalThrowableError;
4342
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
4443

4544
/**
@@ -120,13 +119,8 @@ public function run(InputInterface $input = null, OutputInterface $output = null
120119
$this->configureIO($input, $output);
121120

122121
try {
123-
$e = null;
124122
$exitCode = $this->doRun($input, $output);
125-
} catch (\Exception $e) {
126123
} catch (\Throwable $e) {
127-
}
128-
129-
if (null !== $e) {
130124
if (!$this->catchExceptions || !$e instanceof \Exception) {
131125
throw $e;
132126
}
@@ -201,11 +195,12 @@ public function doRun(InputInterface $input, OutputInterface $output)
201195
if (null !== $this->dispatcher) {
202196
$event = new ConsoleErrorEvent($input, $output, $e);
203197
$this->dispatcher->dispatch(ConsoleEvents::ERROR, $event);
204-
$e = $event->getError();
205198

206199
if (0 === $event->getExitCode()) {
207200
return 0;
208201
}
202+
203+
$e = $event->getError();
209204
}
210205

211206
throw $e;
@@ -849,7 +844,6 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
849844
}
850845

851846
$event = new ConsoleCommandEvent($command, $input, $output);
852-
$e = null;
853847

854848
try {
855849
$this->dispatcher->dispatch(ConsoleEvents::COMMAND, $event);
@@ -862,10 +856,9 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
862856
} catch (\Throwable $e) {
863857
$event = new ConsoleErrorEvent($input, $output, $e, $command);
864858
$this->dispatcher->dispatch(ConsoleEvents::ERROR, $event);
865-
$e = $event->getError();
866859

867860
if (0 !== $exitCode = $event->getExitCode()) {
868-
throw $e;
861+
throw $event->getError();
869862
}
870863
} finally {
871864
$event = new ConsoleTerminateEvent($command, $input, $output, $exitCode);

src/Symfony/Component/Console/composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
],
1818
"require": {
1919
"php": "^7.1.3",
20-
"symfony/polyfill-mbstring": "~1.0",
21-
"symfony/debug": "~3.4|~4.0"
20+
"symfony/polyfill-mbstring": "~1.0"
2221
},
2322
"require-dev": {
2423
"symfony/config": "~3.4|~4.0",

0 commit comments

Comments
 (0)