Review main Merged

90310[TASK] Use DI in ViewHelpers

Simon Schaufelberger CR +2 V +2 Hard +205 −170 updated 08/18/25, 18:58

Commit message

All Fluid ViewHelpers support DI out of the box.
Therefore, classes used within a ViewHelper can be injected.
This change was done with the help of TYPO3 Rector.

Applied rules:
- InjectMethodToConstructorInjectionRector
- GeneralUtilityMakeInstanceToConstructorPropertyRector

IconViewHelper and InfoboxViewHelper cannot be migrated as they are used
in the install tool and there is no DI support.

Code style has been applied with ECS as there are no PHP-CS-Fixer rules
to format constructor properties.

Applied rules:
- StandaloneLineConstructorParamFixer
- StandaloneLinePromotedPropertyFixer

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
    • core-ci +1 CI

Issues 1

Files 27

Show 7 more files

Review log 1927

Show 12 earlier messages
  1. Simon Schaufelberger uploaded patch set 1 08/10/25, 15:30

  2. core-ci voted on patch set 1 V +1 08/10/25, 15:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83104

  1. Oliver Klee voted on patch set 1 CR +1 08/10/25, 16:15

  2. Simon Schaufelberger uploaded patch set 2 CR +1 V +1 08/10/25, 16:29

  3. Simon Schaufelberger uploaded patch set 3 08/10/25, 16:35

  4. core-ci voted on patch set 2 V -1 08/10/25, 16:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83105

  5. core-ci voted on patch set 3 V -1 08/10/25, 16:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83106

  6. Simon Schaufelberger uploaded patch set 4 V -1 08/10/25, 20:11

  7. core-ci voted on patch set 4 V -1 08/10/25, 20:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83107

  8. Simon Schaufelberger uploaded patch set 5 V -1 08/10/25, 21:41

  9. core-ci voted on patch set 5 V +1 08/10/25, 21:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83108

  10. Simon Schaufelberger commented on patch set 5 08/11/25, 00:58

    UploadDeleteCheckboxViewHelper.php:74

    inject as well?
  11. Simon Schaufelberger uploaded patch set 6 V +1 08/11/25, 09:49

  12. Simon Schaufelberger commented on patch set 5 08/11/25, 09:50

    UploadDeleteCheckboxViewHelper.php:74 Reply

    Done
  13. core-ci voted on patch set 6 V +1 08/11/25, 09:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83136

  14. Oliver Klee voted on patch set 6 CR +1 V +1 08/11/25, 10:25

  15. Simon Schaufelberger uploaded patch set 7 CR +1 V +1 08/14/25, 13:25

  16. core-ci voted on patch set 7 V +1 08/14/25, 13:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83391

  17. Jörg Bösche voted on patch set 7 CR +1 08/18/25, 10:30

  18. Oliver Klee voted on patch set 7 CR +1 V +1 08/18/25, 11:08

  19. Christian Kuhn commented on patch set 7 08/18/25, 15:01

    FlashMessagesViewHelper.php:90

    i would opt to keep ExtensionService using makeInstance: This code path is optional, and ExtensionService is one of those ugly extbase classes that has a dependency to stateful configurationManager singleton. having this injected is kinda risky.

    UploadDeleteCheckboxViewHelper.php:70

    same here: hashService DI is fine, but lets keep ExtensionService using makeInstance, at least for now.
  20. Simon Schaufelberger uploaded patch set 8 CR +1 V +1 08/18/25, 16:27

  21. Simon Schaufelberger commented on patch set 8 08/18/25, 16:27

    FlashMessagesViewHelper.php:90 Reply

    Done

    UploadDeleteCheckboxViewHelper.php:70 Reply

    Done
  22. core-ci voted on patch set 8 V +1 08/18/25, 16:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83575

  23. Oliver Klee voted on patch set 8 CR +1 V +1 08/18/25, 16:46

  24. Christian Kuhn voted on patch set 8 CR +2 V +2 08/18/25, 18:58

  25. Christian Kuhn merged patch set 9 08/18/25, 18:58