Upgraded to symfony/console 4.0

This commit is contained in:
Julian Stier 2018-01-25 23:29:03 +01:00
parent 1e0223d11b
commit ccbaba02a6
2 changed files with 4 additions and 4 deletions

View file

@ -14,7 +14,7 @@
"require": {
"php": ">=5.5.9",
"monolog/monolog": "^1.0",
"symfony/console": "^3.0",
"symfony/console": "4.0",
"symfony/filesystem": "^3.0",
"symfony/event-dispatcher": "^3.0",
"symfony/finder": "^3.0",

View file

@ -17,7 +17,7 @@ use Symfony\Component\Finder\SplFileInfo;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\Console\Event\ConsoleExceptionEvent;
use Symfony\Component\Console\Event\ConsoleErrorEvent;
use Symfony\Component\Console\ConsoleEvents;
use Symfony\Component\Console\Application;
use Symfony\Component\Yaml\Parser;
@ -46,12 +46,12 @@ class MageApplication extends Application
$dispatcher = new EventDispatcher();
$this->setDispatcher($dispatcher);
$dispatcher->addListener(ConsoleEvents::EXCEPTION, function (ConsoleExceptionEvent $event) {
$dispatcher->addListener(ConsoleEvents::ERROR, function (ConsoleErrorEvent $event) {
$output = $event->getOutput();
$command = $event->getCommand();
$output->writeln(sprintf('Oops, exception thrown while running command <info>%s</info>', $command->getName()));
$exitCode = $event->getExitCode();
$event->setException(new \LogicException('Caught exception', $exitCode, $event->getException()));
$event->setError(new \LogicException('Caught exception', $exitCode, $event->getError()));
});
$this->runtime = $this->instantiateRuntime();