Skip to content

Commit 80fa854

Browse files
committed
minor #21920 [EventDispatcher] Fix example in event_dispatcher.rst (Mynyx)
This PR was submitted for the 7.3 branch but it was merged into the 7.4 branch instead. Discussion ---------- [EventDispatcher] Fix example in event_dispatcher.rst Injection of ``tokens`` was missing. Commits ------- f90bc9d Fix example in event_dispatcher.rst
2 parents e11c67d + f90bc9d commit 80fa854

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

event_dispatcher.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ event subscribers, you can learn more about :ref:`how to use them <events-subscr
561561
namespace App\EventSubscriber;
562562

563563
use App\Controller\TokenAuthenticatedController;
564+
use Symfony\Component\DependencyInjection\Attribute\Autowire;
564565
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
565566
use Symfony\Component\HttpKernel\Event\ControllerEvent;
566567
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
@@ -569,6 +570,7 @@ event subscribers, you can learn more about :ref:`how to use them <events-subscr
569570
class TokenSubscriber implements EventSubscriberInterface
570571
{
571572
public function __construct(
573+
#[Autowire(param: 'tokens')]
572574
private array $tokens
573575
) {
574576
}

0 commit comments

Comments
 (0)