mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-05-18 13:46:40 +02:00
Upgraded to symfony/console 4.0
This commit is contained in:
parent
1e0223d11b
commit
ccbaba02a6
|
@ -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",
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue