[Console] renamed ConsoleForExceptionEvent into ConsoleExceptionEvent

This commit is contained in:
Tobias Schultze 2013-05-27 12:36:30 +02:00
parent 395ec400d1
commit 554ab9fa86
4 changed files with 6 additions and 6 deletions

View File

@ -31,7 +31,7 @@ use Symfony\Component\Console\Helper\DialogHelper;
use Symfony\Component\Console\Helper\ProgressHelper; use Symfony\Component\Console\Helper\ProgressHelper;
use Symfony\Component\Console\Helper\TableHelper; use Symfony\Component\Console\Helper\TableHelper;
use Symfony\Component\Console\Event\ConsoleCommandEvent; use Symfony\Component\Console\Event\ConsoleCommandEvent;
use Symfony\Component\Console\Event\ConsoleForExceptionEvent; use Symfony\Component\Console\Event\ConsoleExceptionEvent;
use Symfony\Component\Console\Event\ConsoleTerminateEvent; use Symfony\Component\Console\Event\ConsoleTerminateEvent;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
@ -901,7 +901,7 @@ class Application
$event = new ConsoleTerminateEvent($command, $input, $output, $e->getCode()); $event = new ConsoleTerminateEvent($command, $input, $output, $e->getCode());
$this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event); $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event);
$event = new ConsoleForExceptionEvent($command, $input, $output, $e, $event->getExitCode()); $event = new ConsoleExceptionEvent($command, $input, $output, $e, $event->getExitCode());
$this->dispatcher->dispatch(ConsoleEvents::EXCEPTION, $event); $this->dispatcher->dispatch(ConsoleEvents::EXCEPTION, $event);
throw $event->getException(); throw $event->getException();

View File

@ -46,7 +46,7 @@ final class ConsoleEvents
* *
* This event allows you to deal with the exception or * This event allows you to deal with the exception or
* to modify the thrown exception. The event listener method receives * to modify the thrown exception. The event listener method receives
* a Symfony\Component\Console\Event\ConsoleForExceptionEvent * a Symfony\Component\Console\Event\ConsoleExceptionEvent
* instance. * instance.
* *
* @var string * @var string

View File

@ -20,7 +20,7 @@ use Symfony\Component\Console\Output\OutputInterface;
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
*/ */
class ConsoleForExceptionEvent extends ConsoleEvent class ConsoleExceptionEvent extends ConsoleEvent
{ {
private $exception; private $exception;
private $exitCode; private $exitCode;

View File

@ -24,7 +24,7 @@ use Symfony\Component\Console\Output\Output;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tester\ApplicationTester; use Symfony\Component\Console\Tester\ApplicationTester;
use Symfony\Component\Console\Event\ConsoleCommandEvent; use Symfony\Component\Console\Event\ConsoleCommandEvent;
use Symfony\Component\Console\Event\ConsoleForExceptionEvent; use Symfony\Component\Console\Event\ConsoleExceptionEvent;
use Symfony\Component\Console\Event\ConsoleTerminateEvent; use Symfony\Component\Console\Event\ConsoleTerminateEvent;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
@ -788,7 +788,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$event->setExitCode(128); $event->setExitCode(128);
}); });
$dispatcher->addListener('console.exception', function (ConsoleForExceptionEvent $event) { $dispatcher->addListener('console.exception', function (ConsoleExceptionEvent $event) {
$event->getOutput()->writeln('caught.'); $event->getOutput()->writeln('caught.');
$event->setException(new \LogicException('caught.', $event->getExitCode(), $event->getException())); $event->setException(new \LogicException('caught.', $event->getExitCode(), $event->getException()));