Skip to content

Commit

Permalink
bug #4119 Fix class name in ConsoleTerminateListener example (alOneh)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.3 branch.

Discussion
----------

Fix class name in ConsoleTerminateListener example

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3
| Fixed tickets |

Commits
-------

c0cc14f Fix class name in ConsoleTerminateListener example
  • Loading branch information
weaverryan committed Aug 16, 2014
2 parents 84e6e7f + c0cc14f commit c0a0120
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cookbook/console/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ First configure a listener for console terminate events in the service container
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="console_terminate_listener.class">Acme\DemoBundle\EventListener\ConsoleExceptionListener</parameter>
<parameter key="console_exception_listener.class">Acme\DemoBundle\EventListener\ConsoleExceptionListener</parameter>
</parameters>
<services>
<service id="kernel.listener.command_dispatch" class="%console_terminate_listener.class%">
<service id="kernel.listener.command_dispatch" class="%console_exception_listener.class%">
<argument type="service" id="logger"/>
<tag name="kernel.event_listener" event="console.terminate" />
</service>
Expand All @@ -223,11 +223,11 @@ First configure a listener for console terminate events in the service container
use Symfony\Component\DependencyInjection\Reference;
$container->setParameter(
'console_terminate_listener.class',
'console_exception_listener.class',
'Acme\DemoBundle\EventListener\ConsoleExceptionListener'
);
$definitionConsoleExceptionListener = new Definition(
'%console_terminate_listener.class%',
'%console_exception_listener.class%',
array(new Reference('logger'))
);
$definitionConsoleExceptionListener->addTag(
Expand All @@ -247,7 +247,7 @@ Then implement the actual listener::
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
use Psr\Log\LoggerInterface;

class ConsoleTerminateListener
class ConsoleExceptionListener
{
private $logger;

Expand Down

0 comments on commit c0a0120

Please sign in to comment.