Browse files

minor #4422 Fix typos in code (ifdattic)

This PR was merged into the 2.3 branch.


Fix typos in code

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

PS 1: As so far I used only yaml files for services not sure if the changes to XML and PHP code blocks are correct

PS 2: Maybe I configured something wrong or something like that (or you could point me in the right direction for more information), but I don't think the terminate listener will work. In my opinion when command is exited with exception the exit code should be more than zero, but on `ConsoleTerminateEvent` and even on `ConsoleExceptionEvent` the exit code is `0`


2135b82 Change: ConsoleTerminateListener => ErrorLoggerListener
fc403b1 Removed parameters from service
d4ba3c0 Fix typos in code
  • Loading branch information...
weaverryan committed Dec 5, 2014
2 parents 4257a27 + 2135b82 commit 0a9c1467aa858ba9407963cef8455488b2a31877
Showing with 8 additions and 16 deletions.
  1. +8 −16 cookbook/console/logging.rst
@@ -190,7 +190,7 @@ First configure a listener for console terminate events in the service container
# app/config/services.yml
class: Acme\DemoBundle\EventListener\ConsoleTerminateListener
class: Acme\DemoBundle\EventListener\ErrorLoggerListener
logger: "@logger"
@@ -204,12 +204,8 @@ First configure a listener for console terminate events in the service container
<parameter key="console_exception_listener.class">Acme\DemoBundle\EventListener\ConsoleExceptionListener</parameter>
<service id="kernel.listener.command_dispatch" class="%console_exception_listener.class%">
<service id="kernel.listener.command_dispatch" class="Acme\DemoBundle\EventListener\ErrorLoggerListener">
<argument type="service" id="logger"/>
<tag name="kernel.event_listener" event="console.terminate" />
@@ -222,32 +218,28 @@ First configure a listener for console terminate events in the service container
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
$definitionConsoleExceptionListener = new Definition(
$definitionErrorLoggerListener = new Definition(
array(new Reference('logger'))
array('event' => 'console.terminate')
Then implement the actual listener::
// src/Acme/DemoBundle/EventListener/ConsoleExceptionListener.php
// src/Acme/DemoBundle/EventListener/ErrorLoggerListener.php
namespace Acme\DemoBundle\EventListener;
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
use Psr\Log\LoggerInterface;
class ConsoleExceptionListener
class ErrorLoggerListener
private $logger;

0 comments on commit 0a9c146

Please sign in to comment.