90344[TASK] Inject service classes into ViewHelpers which use DI already
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Simon Praetorius +1
-
Verified V +2 Done
- Christian Kuhn +2
- Simon Praetorius +1
- core-ci +1 CI
Issues 1
Files 17
- typo3/sysext/backend/Classes/ViewHelpers/LoginLogoViewHelper.php6+12 −36
- typo3/sysext/extensionmanager/Classes/ViewHelpers/DownloadExtensionViewHelper.php3+13 −21
- typo3/sysext/extensionmanager/Classes/ViewHelpers/ProcessAvailableActionsViewHelper.php1+4 −5
- typo3/sysext/fluid/Classes/ViewHelpers/Asset/CssViewHelper.php1+4 −5
- typo3/sysext/fluid/Classes/ViewHelpers/Asset/ModuleViewHelper.php+3 −6
- typo3/sysext/fluid/Classes/ViewHelpers/Asset/ScriptViewHelper.php+4 −5
- typo3/sysext/fluid/Classes/ViewHelpers/Be/TableListViewHelper.php1+3 −6
- typo3/sysext/fluid/Classes/ViewHelpers/Form/CountrySelectViewHelper.php+2 −1
- typo3/sysext/fluid/Classes/ViewHelpers/Security/NonceViewHelper.php+3 −1
- typo3/sysext/form/Classes/ViewHelpers/Form/DatePickerViewHelper.php3+6 −7
- typo3/sysext/form/Classes/ViewHelpers/Form/TimePickerViewHelper.php+4 −5
- typo3/sysext/form/Classes/ViewHelpers/Form/UploadedResourceViewHelper.php1+5 −11
- typo3/sysext/form/Classes/ViewHelpers/RenderViewHelper.php+3 −6
- typo3/sysext/form/Tests/Unit/ViewHelpers/Form/DatePickerViewHelperTest.php+6 −1
- typo3/sysext/styleguide/Classes/ViewHelpers/CodeViewHelper.php1+9 −11
- typo3/sysext/styleguide/Classes/ViewHelpers/ColorSchemeViewHelper.php+3 −6
- typo3/sysext/styleguide/Classes/ViewHelpers/ExampleViewHelper.php+9 −11
Review log 1115
-
Simon Schaufelberger uploaded patch set 1 08/12/25, 12:56
-
core-ci voted on patch set 1 V -1 08/12/25, 13:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83202
-
Simon Schaufelberger uploaded patch set 2
V -108/12/25, 13:36 -
core-ci voted on patch set 2 V +1 08/12/25, 13:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83206
-
Christian Kuhn commented on patch set 2 08/13/25, 18:33
LoginLogoViewHelper.php:49instead of injecting cacheManager, i prefer direcctly injecting the cache that is needed, in this case the assets cache.LoginLogoViewHelper.php:49matter of taste: in general, i prefer having an additional comma at in last line since adding another DI will then only change one line instead of two.DownloadExtensionViewHelper.php:43note there is an option (using a attribute) to directly inject the config parameter that is needed. iirc a v13 patch documented this.DownloadExtensionViewHelper.php:64note this one is kinda important, especially when uribuilder is injected: UriBuilder is stateful ...ProcessAvailableActionsViewHelper.php:34note @simon@praetorius.me : We should see if we could somehow get rid of __construct() in AbstractTagBasedViewHelper ...CssViewHelper.php:55Note: AssetCollector is designed as a stateful singleton (similar to PageRenderer), we should be careful when injecting it and at least keep that fact in mind. In this case, it "has always been like that", its ok, and we currently have no better solution. just saying here ...TableListViewHelper.php:63(self?)-note: it would be good to refactor this dependency away.DatePickerViewHelper.php:34outdated comment, right?UploadedResourceViewHelper.php:43another stateful singleton, btw ..CodeViewHelper.php:50and another (and rather stupid) stateful singleton. -
Simon Schaufelberger commented on patch set 2 08/13/25, 19:40
DatePickerViewHelper.php:34ReplyRight but I would do some more cleanup in a followup patch as protected can also be private since almost all VHs are final -
Simon Schaufelberger commented on patch set 2 08/13/25, 20:33
LoginLogoViewHelper.php:47ReplyDoneLoginLogoViewHelper.php:49ReplyDoneLoginLogoViewHelper.php:49ReplyDoneDownloadExtensionViewHelper.php:43ReplyDoneDatePickerViewHelper.php:34ReplyDone -
Simon Schaufelberger uploaded patch set 3
V +108/13/25, 20:40 -
Simon Schaufelberger uploaded patch set 4 08/13/25, 20:48
-
core-ci voted on patch set 3 V +1 08/13/25, 20:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83320
-
core-ci voted on patch set 4 V +1 08/13/25, 20:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/83321
-
Christian Kuhn voted on patch set 4 CR +1 V +1 08/14/25, 08:51
-
Simon Praetorius voted on patch set 4 CR +1 V +1 08/14/25, 09:00
-
Christian Kuhn voted on patch set 4 CR +2 V +2 08/14/25, 09:00
-
Christian Kuhn merged patch set 5 08/14/25, 09:00
LoginLogoViewHelper.php:47