Review main Merged Breaking

75749[!!!][TASK] Cleanup and harden Extbase Request

Christian Kuhn CR +2 V +2 Expert +402 −674 updated 09/18/22, 17:51

Commit message

The Extbase Request has been turned into a
PSR-7 decorator in v11. Most interface changes
have not been enforced in v11 though, since that
would have been breaking at this point in the
release cycle.

With v12, we can now activate the RequestInterface
changes. The patch does this, and migrates the "setX()"
that violate PSR-7 request immutability towards
their 'withX()' counterparts which create new
objects.

The patch adds quite a bit of syntactic sugar to
consuming classes: core phpstan is significantly more
happy and extbase extension devs benefit from
improved type hints and interface coverage.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Lina Wolf +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Lina Wolf +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 2

Files 32

Show 12 more files

Review log 3253

Show 1428 earlier messages
  1. Christian Kuhn uploaded patch set 1 09/17/22, 17:53

  2. core-ci voted on patch set 1 V -1 09/17/22, 18:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31212

  3. Christian Kuhn uploaded patch set 2 09/17/22, 19:09

  4. core-ci voted on patch set 2 V +1 09/17/22, 19:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31214

  5. Christian Kuhn uploaded patch set 3 09/17/22, 19:25

  6. core-ci voted on patch set 3 V +1 09/17/22, 19:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31215

  7. Christian Kuhn uploaded patch set 4 09/18/22, 09:28

  8. core-ci voted on patch set 4 V +1 09/18/22, 09:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31224

  9. Christian Kuhn uploaded patch set 5 09/18/22, 09:41

  10. core-ci voted on patch set 5 V -1 09/18/22, 09:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31225

  11. Christian Kuhn uploaded patch set 6 09/18/22, 09:51

  12. core-ci voted on patch set 6 V -1 09/18/22, 09:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31226

  13. Christian Kuhn uploaded patch set 7 09/18/22, 10:06

  14. core-ci voted on patch set 7 V +1 09/18/22, 10:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31227

  15. Christian Kuhn uploaded patch set 8 09/18/22, 10:33

  16. core-ci voted on patch set 8 V -1 09/18/22, 10:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31228

  17. Christian Kuhn uploaded patch set 9 09/18/22, 12:14

  18. core-ci voted on patch set 9 V +1 09/18/22, 12:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31233

  19. Christian Kuhn uploaded patch set 10 09/18/22, 12:55

  20. core-ci voted on patch set 10 V +1 09/18/22, 13:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31234

  21. Christian Kuhn uploaded patch set 11 09/18/22, 13:06

  22. core-ci voted on patch set 11 V +1 09/18/22, 13:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31235

  23. Christian Kuhn uploaded patch set 12 09/18/22, 13:14

  24. core-ci voted on patch set 12 V +1 09/18/22, 13:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31236

  25. Christian Kuhn uploaded patch set 13 09/18/22, 13:30

  26. core-ci voted on patch set 13 V +1 09/18/22, 13:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31237

  27. Christian Kuhn uploaded patch set 14 09/18/22, 13:55

  28. core-ci voted on patch set 14 V +1 09/18/22, 14:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31238

  1. Lina Wolf commented on patch set 14 09/18/22, 14:41

    Happy that you are working on this, I will sit back and watch 😎
  2. Christian Kuhn uploaded patch set 15 09/18/22, 14:41

  3. core-ci voted on patch set 15 V -1 09/18/22, 14:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31239

  4. Christian Kuhn uploaded patch set 16 09/18/22, 14:49

  5. Christian Kuhn updated the commit message in patch set 17 09/18/22, 14:57

  6. core-ci voted on patch set 16 V +1 09/18/22, 14:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31240

  7. Christian Kuhn voted on patch set 17 CR -1 09/18/22, 14:58

  8. core-ci voted on patch set 17 V +1 09/18/22, 15:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31241

  9. Christian Kuhn uploaded patch set 18 09/18/22, 15:50

  10. core-ci voted on patch set 18 V +1 09/18/22, 15:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31242

  11. Christian Kuhn uploaded patch set 19 09/18/22, 16:00

  12. Lina Wolf commented on patch set 19 09/18/22, 16:02

    Breaking-98370-ExtbaseRequestCleanupAndHardening.rst:73

    Is it not possible to scan for usage of these setXY methods?
  13. Christian Kuhn uploaded patch set 20 09/18/22, 16:03

  14. Christian Kuhn commented on patch set 19 09/18/22, 16:06

    Breaking-98370-ExtbaseRequestCleanupAndHardening.rst:73 Reply

    yes and no: There are *some* methods that are kinda specific, but things like "setFormat()" are quite generic and would lead to lots of false positives with the extension scanner. I think a tool like phpstan established for extbase extensions is better suited here, so I decided to not add scanner entries for the 'setter' methods that have been removed.
  15. core-ci voted on patch set 19 V +1 09/18/22, 16:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31244

  16. core-ci voted on patch set 20 V +1 09/18/22, 16:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31245

  17. Lina Wolf commented on patch set 20 CR +1 09/18/22, 16:20

    Code looks good to me as far as I can tell. Testing now.
  18. Stefan Bürk commented on patch set 20 09/18/22, 16:45

    Breaking-98370-ExtbaseRequestCleanupAndHardening.rst:14

    Don't we normally write php full quallified namespaces classes (fqnc) with leading backslash, or am I wrong ? (If yes, more occurances in this file.)

    PasswordRecoveryController.php:99

    Should we not add that attribute at least to the PHPStorm meta file, avoiding the need for variable docblock ? Edit: arg .. we need to extend the phpstan extension to to make phpstan happy then.

    StandaloneView.php:56

    Missing $request = assigment ? ``` $request = $request->withFormat($format); ```

    FluidTemplateContentObject.php:272

    Request no imutable - retrieved in L231 into local variable from $this->request. It is eventually changed, but not reassigned to $this->request ... missing or intended to reasign changed $request not only to view but to class property also ?
  19. Christian Kuhn commented on patch set 20 09/18/22, 16:58

    Breaking-98370-ExtbaseRequestCleanupAndHardening.rst:14 Reply

    unsure. can add the here to be more precise.

    PasswordRecoveryController.php:99 Reply

    yeah. we'd need a mapping then. left out for now, might be a dedicated task if we wish to solve this.

    StandaloneView.php:56 Reply

    thx. good catch.

    FluidTemplateContentObject.php:272 Reply

    thx. good catch.
  20. Christian Kuhn uploaded patch set 21 09/18/22, 16:58

  21. Lina Wolf commented on patch set 21 V +1 CR +1 09/18/22, 17:06

    Tested with fe_login, forms, (as provided by styleguide), friendsoftypo3/blog-example:dev-12.0-dev and ttn/tea:dev-lwolf-v12-compability Behaviour before and after change is the same as far as I can tell.
  22. core-ci voted on patch set 21 V +1 09/18/22, 17:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31246

  23. Stefan Bürk commented on patch set 21 V +1 CR +1 09/18/22, 17:45

    PasswordRecoveryController.php:99 Reply

    ack to dedicated task.
  24. Christian Kuhn voted on patch set 21 V +2 CR +2 09/18/22, 17:51

  25. Christian Kuhn merged patch set 22 09/18/22, 17:51