From 453e7996abf7562ac3a4741931d74d4c9fd40e23 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Mon, 13 Nov 2017 22:10:39 +0100 Subject: [PATCH] [Console] remove debug dependency that was dead code --- src/Symfony/Component/Console/Application.php | 13 +++---------- src/Symfony/Component/Console/composer.json | 3 +-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 8650ae644cd8c..96b80ac1930e5 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -39,7 +39,6 @@ use Symfony\Component\Console\Event\ConsoleTerminateEvent; use Symfony\Component\Console\Exception\CommandNotFoundException; use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Debug\Exception\FatalThrowableError; use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** @@ -120,13 +119,8 @@ public function run(InputInterface $input = null, OutputInterface $output = null $this->configureIO($input, $output); try { - $e = null; $exitCode = $this->doRun($input, $output); - } catch (\Exception $e) { } catch (\Throwable $e) { - } - - if (null !== $e) { if (!$this->catchExceptions || !$e instanceof \Exception) { throw $e; } @@ -201,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(); if (0 === $event->getExitCode()) { return 0; } + + $e = $event->getError(); } throw $e; @@ -849,7 +844,6 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI } $event = new ConsoleCommandEvent($command, $input, $output); - $e = null; try { $this->dispatcher->dispatch(ConsoleEvents::COMMAND, $event); @@ -862,10 +856,9 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI } catch (\Throwable $e) { $event = new ConsoleErrorEvent($input, $output, $e, $command); $this->dispatcher->dispatch(ConsoleEvents::ERROR, $event); - $e = $event->getError(); if (0 !== $exitCode = $event->getExitCode()) { - throw $e; + throw $event->getError(); } } finally { $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode); diff --git a/src/Symfony/Component/Console/composer.json b/src/Symfony/Component/Console/composer.json index 0b422907bf45d..b11991944435f 100644 --- a/src/Symfony/Component/Console/composer.json +++ b/src/Symfony/Component/Console/composer.json @@ -17,8 +17,7 @@ ], "require": { "php": "^7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/debug": "~3.4|~4.0" + "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { "symfony/config": "~3.4|~4.0",