Skip to content

#189 - Fix EventDispatcherTask ignoring the event_name option - #196

Open
Tmalboeuf-CA wants to merge 1 commit into
mainfrom
189
Open

Tmalboeuf-CA wants to merge 1 commit into
mainfrom
189

Conversation

@Tmalboeuf-CA

Copy link
Copy Markdown
Collaborator

Description

Fixes #189.

EventDispatcherTask dispatched its event without a name, so listeners registered on event_name were never called (regression from a833456, v4.0).

  • The event is dispatched under event_name again.
  • As requested, event_name is now optional and nullable, consistent with EventDispatcherInterface::dispatch(object $event, ?string $eventName = null). When it is null (default), the event is dispatched under its class name, as before.
  • The reference documentation now explains both modes.

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

None: configurations without event_name keep dispatching under the event class name. Listeners on EventDispatcherTaskEvent are still called when event_name is not set.

The event was dispatched without a name, so it was only dispatched under
its class name and listeners registered on the configured `event_name`
were never called. Regression from a833456 (v4.0).

- Dispatch the event under `event_name` again
- Make `event_name` optional and nullable, consistently with
  EventDispatcherInterface::dispatch(): when null (default), the event is
  dispatched under its class name, as before
- Update the reference documentation

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EventDispatcherTask ignores the event_name option

1 participant