Skip to content
Snippets Groups Projects
Commit 85d0df50 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] Modernize ViewHelper classes

The patch makes the bulk of ViewHelper classes more
strict and applies some general love. Some ViewHelpers
have been left, those will see bigger refactorings
soon. All affected classes are final, the changes are
(hopefully) non-breaking.

* declare(strict_types=1) if missing.
* Use self:: instead of static:: since all VH's
  are final, so there is not point in using late
  static binding.
* Return and argument type hints where possible and
  reduction of methods doc annotations which are
  covered by PHP method signatures.
* Add types to some class properties.
* Protect some detail methods that were apparently
  public by accident. This is not considered breaking.
* Avoid extbase LocalizationUtility::translate() in
  favor of core LanguageService.
* Avoid static class state, especially with TSFE.
* Minor comment fixes.

Change-Id: I4e3b9d01ea92802e47d05a10f4243196120b8510
Resolves: #96400
Related: #96368
Releases: main
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72741


Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 4c0a7851
Showing
with 120 additions and 222 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment