minor #21888 [EventDispatcher] Add missing use statement for CustomEvent in AsEven… (lacatoire)

This PR was merged into the 7.3 branch.

Discussion
----------

[EventDispatcher] Add missing use statement for CustomEvent in AsEven…

fixes #21002

Commits
-------

2a18b16f9 [EventDispatcher] Add missing use statement for CustomEvent in AsEventListener examples
This commit is contained in:
Javier Eguiluz
2026-02-10 08:55:35 +01:00

View File

@@ -154,6 +154,7 @@ having to add any configuration in external files::
namespace App\EventListener;
use App\Event\CustomEvent;
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;
#[AsEventListener]
@@ -172,6 +173,7 @@ doesn't explicitly define its method, so the ``onFoo()`` method will be called::
namespace App\EventListener;
use App\Event\CustomEvent;
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;
#[AsEventListener(event: CustomEvent::class, method: 'onCustomEvent')]
@@ -200,6 +202,7 @@ can also be applied to methods directly::
namespace App\EventListener;
use App\Event\CustomEvent;
use Symfony\Component\EventDispatcher\Attribute\AsEventListener;
final class MyMultiListener