Review main Merged

82510[TASK] Avoid TSFE getSite(), getLanguage(), pageArguments

Christian Kuhn CR +2 V +2 Hard +118 −324 updated 01/19/24, 12:02

Commit message

Next logical step on the 'get rid of TSFE' path:
Avoid the @internal public getters getSite() and
getLanguage(), retrieve them from the Request
where needed instead. By additionally avoiding
already unused PageArguments, TSFE __construct()
no longer needs manual arguments.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 14

Review log 1725

  1. Christian Kuhn uploaded patch set 1 01/18/24, 12:10

  2. core-ci voted on patch set 1 V +1 01/18/24, 12:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51748

  3. Christian Kuhn uploaded patch set 2 V +1 01/18/24, 13:23

  4. core-ci voted on patch set 2 V +1 01/18/24, 13:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51757

  5. Christian Kuhn uploaded patch set 3 V +1 01/18/24, 14:02

  6. core-ci voted on patch set 3 V +1 01/18/24, 14:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51759

  7. Christian Kuhn uploaded patch set 4 V +1 01/18/24, 15:01

  8. core-ci voted on patch set 4 V +1 01/18/24, 15:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51765

  9. Benjamin Franzke commented on patch set 4 01/18/24, 15:14

    Maybe a general note/opionen: Let's not replace existing explicit method parameters types like `SiteInterface` or `Language` with our "attribute-bag" named `$request`. Yes, `$request` is our bag for stateful stuff (like `ContainerInterface` for services), but we should depend on concrete instances in API/code, where possible – makes such functions more scoped. I think I saw only one such case (a `SiteInterface` parameter) in this change, but as I don't exactly know what is coming up I just wanted to say that "early" enough ;)
  10. Christian Kuhn uploaded patch set 5 V +1 01/18/24, 16:19

  11. core-ci voted on patch set 5 V -1 01/18/24, 16:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51769

  12. Christian Kuhn uploaded patch set 6 V -1 01/18/24, 16:29

  13. Christian Kuhn commented on patch set 6 01/18/24, 16:37

    Reply

    Yeah. Well. It depends. There are a couple of middlewares that check existance of attributes "must exist at this point" already. The added @todo's are a hint we should add more. The main issue is here that psr-7 allows 'null' return for attributes - a flaw in the spec that stems from earlier PHP versions and could be done much better nowadays. I think we should have more per-class get'ers that retrieve the request and return some non-null attribute, instead, which would clearify and harden request attribute dependencies. At the moment, we've already hardened a couple of these, but try to keep others as much as compatible as possible - for instance in the 'link builder' classes. We should harden further harden this and some @todos already point this out.
  14. core-ci voted on patch set 6 V +1 01/18/24, 16:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51770

  15. Christian Kuhn commented on patch set 6 01/18/24, 16:42

    Reply

    Note especially everything around the 'link builder' structure is problematic in this area since those may or may not be called within FE scope with or without request. I have some other @todos that show this needs to be specified and cleared up early (in LinkFactory, which currently fetches the request from globals). This needs decisions that I delayed for now. And yes, this sucks and must be sorted out.
  16. Christian Kuhn uploaded patch set 7 V +1 01/18/24, 17:25

  17. core-ci voted on patch set 7 V +1 01/18/24, 17:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51777

  18. Christian Kuhn uploaded patch set 8 V +1 01/18/24, 17:34

  19. core-ci voted on patch set 8 V +1 01/18/24, 17:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51779

  20. Stefan Bürk voted on patch set 8 CR +1 01/18/24, 17:57

  21. Stefan Bürk voted on patch set 8 V +1 01/18/24, 18:26

  22. Oliver Klee voted on patch set 8 V +1 01/18/24, 22:07

  23. Nikita Hovratov voted on patch set 8 CR +1 01/19/24, 10:15

  24. Christian Kuhn voted on patch set 8 CR +2 V +2 01/19/24, 12:02

  25. Christian Kuhn merged patch set 9 01/19/24, 12:02