File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -100,13 +100,17 @@ using a special "tag":
100
100
.. code-block :: php
101
101
102
102
// config/services.php
103
+ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
104
+
103
105
use App\EventListener\ExceptionListener;
104
-
105
- $services = $containerConfigurator->services();
106
106
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
+ };
110
114
111
115
Symfony follows this logic to decide which method to call inside the event
112
116
listener class:
You can’t perform that action at this time.
0 commit comments