Review main Merged

73261[TASK] Streamline getLanguageService function

Torben Hansen CR +2 V +2 Hard +91 −603 updated 02/02/22, 18:49

Commit message

Many classes in TYPO3 have a function called
getLanguageService(). The function definition
is not always equal and some functions have
a return type or doc comment and others do not.

This patch streamlines the function as following:

* It must always use a return type declaration
* It must not contain a doc comment header

Also, the superfluous override of getLanguageService()
in some subclasses extending AbstractFormElement has
been removed.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oliver Klee +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 145

Show 125 more files

Review log 1113

  1. Torben Hansen uploaded patch set 1 02/02/22, 14:55

  2. core-ci voted on patch set 1 V +1 02/02/22, 15:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22908

  3. Oliver Klee voted on patch set 1 CR +1 02/02/22, 15:13

  4. Stefan Bürk commented on patch set 1 CR -1 02/02/22, 15:43

    Thanks for the patch. I have two minor comments which should be adjusted. A lot of work so really thanks. At some places removing docblcok from getBackendUser() related methods would have been nice, but don't take that as a blocker.

    ModuleLoaderTest.php:36

    Please use ``` /** @var ObjectPropecy<LanguageService> $languageServicePhrophet = ... ``` We had a patch removing them, and Benjamin had to create a follow up patch to put them back in a proper way. See: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73259

    BackendUtilityTest.php:159

  5. Stefan Bürk commented on patch set 1 02/02/22, 15:44

    ModuleLoaderTest.php:36 Reply

    $languageServicePhropecy .. sry ;)
  6. Torben Hansen commented on patch set 1 02/02/22, 18:04

    Reply

    I will create a separate patch for the similar changes to getBackendUser()

    ModuleLoaderTest.php:36 Reply

    I now renamed $languageService to $languageServiceProphecy to be more specific that we have a prophecy here. But: The referred patch does only bring back the annotations for class properties or function results. For local usage of prophecies in functions this does not seem to be required. Do you agree?
  7. Torben Hansen uploaded patch set 2 02/02/22, 18:05

  8. core-ci voted on patch set 2 V +1 02/02/22, 18:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22913

  9. Oliver Klee voted on patch set 2 CR +1 02/02/22, 18:15

  10. Stefan Bürk commented on patch set 2 V +1 CR +1 02/02/22, 18:21

    ModuleLoaderTest.php:36 Reply

    Thanks Torben, and you are absoluty right. So let it be the same here, but thanks for revisiting and at least renaming the variable name. Maybe we should "check" if this should be done for these kinds to, will ping Benjamin about this. Maybe we will do a dedicated patch than - or not.
  11. Stefan Bürk commented on patch set 2 02/02/22, 18:21

    BackendUtilityTest.php:159 Reply

    Done
  12. Benni Mack commented on patch set 2 V +2 CR +2 02/02/22, 18:49

    Thank you!
  13. Benni Mack merged patch set 3 02/02/22, 18:49