Skip to content

Commit 6afd6a7

Browse files
committed
minor #14053 Update event_dispatcher.rst (yivi)
This PR was merged into the 5.1 branch. Discussion ---------- Update event_dispatcher.rst Update code example to match 5.1 PHP configuration format. <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- b92adf6 Update event_dispatcher.rst
2 parents 8ed3a05 + b92adf6 commit 6afd6a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

event_dispatcher.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ using a special "tag":
101101
102102
// config/services.php
103103
use App\EventListener\ExceptionListener;
104+
105+
$services = $containerConfigurator->services();
104106
105-
$container->register(ExceptionListener::class)
107+
$services->set(ExceptionListener::class)
106108
->addTag('kernel.event_listener', ['event' => 'kernel.exception'])
107109
;
108110

0 commit comments

Comments
 (0)