Skip to content

Commit 03f119a

Browse files
committed
Tweaks
1 parent 6afd6a7 commit 03f119a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

event_dispatcher.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,17 @@ using a special "tag":
100100
.. code-block:: php
101101
102102
// config/services.php
103+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
104+
103105
use App\EventListener\ExceptionListener;
104-
105-
$services = $containerConfigurator->services();
106106
107-
$services->set(ExceptionListener::class)
108-
->addTag('kernel.event_listener', ['event' => 'kernel.exception'])
109-
;
107+
return function(ContainerConfigurator $configurator) {
108+
$services = $configurator->services();
109+
110+
$services->set(ExceptionListener::class)
111+
->addTag('kernel.event_listener', ['event' => 'kernel.exception'])
112+
;
113+
};
110114
111115
Symfony follows this logic to decide which method to call inside the event
112116
listener class:

0 commit comments

Comments
 (0)