Skip to content

#238 - Event listeners declared with explicit kernel.event_listener tags (new EventSubscriberToAttributeRector rule) - #239

Merged
njoubert-cleverage merged 2 commits into
mainfrom
238
Nov 2, 2026
Merged

njoubert-cleverage merged 2 commits into
mainfrom
238

Conversation

@njoubert-cleverage

@njoubert-cleverage njoubert-cleverage commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Description

Fixes #238, fixes #235.

The weekly Quality build fails since 2026-11-02: the new EventSubscriberToAttributeRector rule wants #[AsEventListener] attributes instead of EventSubscriberInterface. The attributes need autoconfiguration, which the bundle does not use (Symfony best practices for bundles, checked by testServicesAreDefinedExplicitly).

  • ProcessEventSubscriber, UploadedFileSubscriber and ProcessExecutionNotifier no longer implement EventSubscriberInterface: their listeners are declared with kernel.event_listener tags in config/services/.

  • Same events, methods and priorities, except flushDoctrineLogs: priority 101 instead of 100, so that it still runs before success() / fail() (before, the order came from the getSubscribedEvents() array; with tags, from the tag order). The logs are still saved before the end of the process execution.

  • Unused event arguments removed by Rector (flushDoctrineLogs(), onMessageHandled()).

  • Tests: the getSubscribedEvents() tests are replaced by a test of the tags (CleverAgeUiProcessExtensionTest::testEventListeners); the tests dispatching events register the listeners with addListener().

  • Also includes the commit of #235 - LoginThrottlingTest: do not assert the number of minutes of the throttling message #236 (LoginThrottlingTest fails with the latest Symfony versions (weekly build) #235: LoginThrottlingTest no longer asserts the number of minutes computed by Symfony), which fails without the Rector fix: each PR needed the other to pass the required checks.

Quality and tests only: no CHANGELOG entry.

Requirements

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

Breaking changes

ProcessEventSubscriber and UploadedFileSubscriber are internal. ProcessExecutionNotifier is final and no longer an EventSubscriberInterface (no getSubscribedEvents()): only code calling this method or registering the class as a subscriber itself is concerned.

🤖 Generated with Claude Code

…ags instead of event subscribers (new EventSubscriberToAttributeRector rule)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage requested a review from a team as a code owner November 2, 2026 13:23
…e only, the number of minutes is computed by Symfony

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage merged commit 8fcaef7 into main Nov 2, 2026
25 checks passed
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.

Weekly Quality build fails: new EventSubscriberToAttributeRector rule LoginThrottlingTest fails with the latest Symfony versions (weekly build)

1 participant