merged branch Tobion/console-event-name (PR #8147)

This PR was merged into the 2.3 branch.

Discussion
----------

[Console] renamed ConsoleForExceptionEvent into ConsoleExceptionEvent

I wondered about the name and now I figured the problem was already raised in the PR: https://github.com/symfony/symfony/pull/7466#discussion-diff-3503539

So I think it should be fixed for LTS.

BC break: yes
test pass: yes

Commits
-------

554ab9f [Console] renamed ConsoleForExceptionEvent into ConsoleExceptionEvent
This commit is contained in:
Fabien Potencier 2013-05-27 16:49:36 +02:00
commit 0270136664
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\TableHelper;
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\EventDispatcher\EventDispatcher;
@ -901,7 +901,7 @@ class Application
$event = new ConsoleTerminateEvent($command, $input, $output, $e->getCode());
$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);
throw $event->getException();

View File

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

View File

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

View File

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