@@ -139,11 +139,10 @@ Then implement the actual listener::
139
139
namespace Acme\DemoBundle\EventListener;
140
140
141
141
use Symfony\Component\Console\Event\ConsoleExceptionEvent;
142
- use \ Psr\Log\LoggerInterface;
142
+ use Psr\Log\LoggerInterface;
143
143
144
144
class ConsoleExceptionListener
145
145
{
146
- /** @var $logger LoggerInterface */
147
146
private $logger;
148
147
149
148
public function __construct(LoggerInterface $logger)
@@ -168,9 +167,11 @@ Then implement the actual listener::
168
167
}
169
168
}
170
169
171
- In the code above, when a command throws an exception, the listener will
170
+ In the code above, when any command throws an exception, the listener will
172
171
receive an event. You can simply log it by passing the logger service via the
173
- service configuration.
172
+ service configuration. Your method receives a
173
+ :class: `Symfony\\ Component\\ Console\\ Event\\ ConsoleExceptionEvent` ` object,
174
+ which has methods to get information about the event and the exception.
174
175
175
176
Logging non-0 exit statuses
176
177
---------------------------
@@ -243,11 +244,10 @@ Then implement the actual listener::
243
244
namespace Acme/DemoBundle\EventListener;
244
245
245
246
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
246
- use \ Psr\Log\LoggerInterface;
247
+ use Psr\Log\LoggerInterface;
247
248
248
249
class ConsoleTerminateListener
249
250
{
250
- /** @var $logger LoggerInterface */
251
251
private $logger;
252
252
253
253
public function __construct(LoggerInterface $logger)
0 commit comments