Review main Merged

61289[TASK] Clean up TSFE constructor initialization

Benni Mack CR +2 V +2 Normal +148 −37 updated 07/18/19, 12:50

Commit message

Due to e50b1c1acdd5da514a35f837d9b853692bcfa16d
the TypoScriptFrontendController requires four objects
as constructor arguments while keeping maximum
compatibility by fetching fallback information from the
current PSR-7 object or setting data from the legacy arguments.

The constructor is cleaned up with special initialize methods
for readability.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Oliver Klee +1
    • Susi Moog +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Susi Moog +1
    • TYPO3com +1 CI

Issues 2

Files 2

Review log 1316

  1. Benni Mack uploaded patch set 1 07/13/19, 17:03

  2. TYPO3com voted on patch set 1 V +1 07/13/19, 17:18 Completed build in 14m 20s on Sat, 13 Jul, 07:18 PM Test Summary: 46998 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35009

  3. Oliver Klee commented on patch set 1 07/13/19, 21:02

    TypoScriptFrontendController.php:674 Unresolved

    So this should be Context|array|null, I guess.

    TypoScriptFrontendController.php:676 Unresolved

    SiteLanguage|int|string, I think

    TypoScriptFrontendController.php:688 Unresolved

    Can we have an @var annotation for this variable?

    TypoScriptFrontendController.php:775 Unresolved

    type missing

    TypoScriptFrontendController.php:835

    Please let's name this differently than the parameter.
  4. Oliver Klee commented on patch set 1 07/16/19, 11:15

    TypoScriptFrontendController.php:832 Unresolved

    I propose we convert this into a guard clause.

    TypoScriptFrontendController.php:834 Unresolved

    This can be a guard clause, too.

    TypoScriptFrontendController.php:835 Reply Unresolved

    Background: First, when I had a look at the method, I saw the declaration and the return value, and thought: "That's the same variable. We can drop the return statement as it's passed by reference." And then I read the method body and noticed that $pageArguments is first as the method argument, and after that for the return value (i.e., with a different meaning.) That's the kind of confusion we can avoid by not changing/overwriting parameters.
  5. Benni Mack uploaded patch set 2 07/18/19, 06:33

  6. TYPO3com voted on patch set 2 V +1 07/18/19, 06:45 Completed build in 11m 07s on Thu, 18 Jul, 08:45 AM Test Summary: 47122 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35150

  7. Georg Ringer voted on patch set 2 V +1 CR +1 07/18/19, 07:06

  8. Susi Moog commented on patch set 2 07/18/19, 07:15

    TypoScriptFrontendController.php:762 Unresolved

    should this also trigger a deprecation log entry?

    TypoScriptFrontendController.php:791 Unresolved

    why not use `$this->type ?: ($queryParams['type'] ?? $request->getParsedBody()['type'] ?? 0);`
  9. Oliver Klee commented on patch set 2 07/18/19, 07:26

    TypoScriptFrontendController.php:780 Unresolved

    Here, we can also have a type declaration for $pageArguments.
  10. Benni Mack uploaded patch set 3 07/18/19, 07:28

  11. TYPO3com voted on patch set 3 V +1 07/18/19, 07:38 Completed build in 09m 52s on Thu, 18 Jul, 09:38 AM Test Summary: 47122 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35155

  12. Susi Moog voted on patch set 3 CR +1 07/18/19, 07:59

  13. Susi Moog voted on patch set 3 V +1 07/18/19, 08:09

  14. Oliver Klee voted on patch set 3 CR +1 07/18/19, 10:18

  15. Georg Ringer voted on patch set 3 V +2 CR +2 07/18/19, 10:59

  16. Benni Mack merged patch set 4 07/18/19, 12:50