Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions event_dispatcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ can also be applied to methods directly::
// ...
}

#[AsEventListener]
public function onMultipleCustomEvent(CustomEvent|AnotherCustomEvent $event): void
{
// ...
}

#[AsEventListener(event: 'foo', priority: 42)]
public function onFoo(): void
{
Expand All @@ -228,6 +234,10 @@ can also be applied to methods directly::
Note that the attribute doesn't require its ``event`` parameter to be set
if the method already type-hints the expected event.

.. versionadded:: 7.4

The support for union types in the method type-hints was introduced in Symfony 7.4.

.. _events-subscriber:

Creating an Event Subscriber
Expand Down