Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Ready for review Stale

95320[TASK] Deprecate package event accessor methods

Wouter Wolters CR 0 V 0 Normal +53 −2 updated 08/14/26, 21:34

Commit message

Deprecate PackageInitializationEvent::getContainer() and
getEmitter(), as well as
AfterPackageActivationEvent::getEmitter(). Keep their behavior intact
during TYPO3 v15 without triggering runtime deprecation notices.

Add extension scanner coverage for getEmitter() usages and document
the migration to injected services and emitter-independent listeners.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 3
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/20/95320/3 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/20/95320/3 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Issues 1

Files 4

Review log 710

  1. Wouter Wolters uploaded patch set 1 08/13/26, 16:32

  2. Wouter Wolters updated the commit message in patch set 2 08/13/26, 16:36

  3. core-ci voted on patch set 1 V +1 08/13/26, 16:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106663

  4. core-ci voted on patch set 2 V +1 08/13/26, 16:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106664

  5. Georg Ringer voted on patch set 2 CR +1 V +1 08/13/26, 17:36

  6. Stefan Bürk uploaded patch set 3 CR +1 V +1 08/14/26, 21:10

  7. core-ci voted on patch set 3 V +1 08/14/26, 21:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106731

  8. Stefan Bürk voted on patch set 3 CR +1 V +1 08/14/26, 21:25

  9. Stefan Bürk voted on patch set 3 CR 0 V 0 08/14/26, 21:27

  10. Stefan Bürk commented on patch set 3 08/14/26, 21:33

    Left an inline comment on the remaining Core-side getEmitter() usage in ext:extensionmanager, plus a question about the intended final step.

    AfterPackageActivationEvent.php:44 Unresolved

    Commenting here because the file it is really about is not part of this changeset: `typo3/sysext/extensionmanager/Classes/Initialization/DispatchAfterPackageActivationEventOnPackageInitialization.php:43`. That listener still calls the now deprecated `PackageInitializationEvent::getEmitter()` and forwards the value straight into this event's constructor, so Core keeps a caller of both accessors this change deprecates. Two things follow from that: * The changelog tells extension authors to "remove calls to `getEmitter()`", while Core keeps one. That is not wrong per se - the value has to come from somewhere as long as this event accepts an emitter - but it should be a conscious decision, otherwise the next reader will "fix" it. * `__construct()` still takes `?object $emitter = null`, and once the deprecated accessor is gone in v16 that argument has no reader left. If the emitter is meant to disappear entirely, the constructor argument should be marked for removal in the same go and the listener should stop forwarding it. @typo3@helhum.io: you added the `@todo deprecate properly with TYPO3 v15` markers with #109597 (change 93688) and deliberately kept container and emitter for backwards compatibility. What was the plan for the final step from your side - dropping the emitter from `AfterPackageActivationEvent` as well (breaking), or keeping the constructor argument and only removing the accessor? That decides whether the listener can be cleaned up right away or has to stay as is for v15. Not blocking from my side, it should just not get lost.