Review main Merged

55754[TASK] Create own response instance in controller actions

Christian Kuhn CR +2 V +2 Hard +365 −536 updated 02/16/18, 20:15

Commit message

To further support the PSR-7 / PSR-15 and removal of
GeneralUtility::_GP() and friends efforts, all controllers
no longer use the second 'ResponseInterface $response'
argument given by dispatchers: Dispatchers should not
assume which type of response a controller returns, there
is no point in preparing this object.

Instead, controllers now always create one of
HtmlResponse, JsonResponse or RedirectResponse on
their own and return these objects.

Changes overview:
* Always use "new" to instantiate a response, PSR-15
  middlewares allow fiddling with the object if needed,
  xclassing these classes is never needed, we instead
  can rely on proper API usage.
* All controller actions drop the second $response argument
  and add ResponseInterface return type hint.
* Some controllers action also drop first $request argument,
  but only if the action does not need access to ServerParams
  at all. Those controllers that access _GP or _POST or similar
  currently, keep $request for now - they have to be refactored
  later anyway and then need $request.

Review

  • Code review CR +2
    • Christian Kuhn +2
    • Mathias Schreiber +1
    • Anja Leichsenring +1
    • Benjamin Kott +1
  • Verified V +2
    • Christian Kuhn +2
    • Mathias Schreiber +1
    • Anja Leichsenring +1
    • Benjamin Kott +1
    • TYPO3com +1 CI

Issues 1

Files 74

Show 54 more files

Review log 1525

  1. Christian Kuhn uploaded patch set 1 02/16/18, 13:04

  2. TYPO3com voted on patch set 1 V -1 02/16/18, 13:04 Completed build in 08s on Fri, 16 Feb, 02:04 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19703

  3. Christian Kuhn uploaded patch set 2 02/16/18, 13:23

  4. TYPO3com voted on patch set 2 V +1 02/16/18, 13:31 Completed build in 07m 50s on Fri, 16 Feb, 02:31 PM Test Summary: 30836 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19704

  5. Christian Kuhn uploaded patch set 3 02/16/18, 14:06

  6. TYPO3com voted on patch set 3 V +1 02/16/18, 14:15 Completed build in 08m 20s on Fri, 16 Feb, 03:15 PM Test Summary: 30836 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19706

  7. Christian Kuhn uploaded patch set 4 02/16/18, 14:38

  8. TYPO3com voted on patch set 4 V +1 02/16/18, 14:47 Completed build in 09m 23s on Fri, 16 Feb, 03:47 PM Test Summary: 30836 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19710

  9. Christian Kuhn uploaded patch set 5 02/16/18, 15:04

  10. TYPO3com voted on patch set 5 V +1 02/16/18, 15:16 Completed build in 11m 41s on Fri, 16 Feb, 04:16 PM Test Summary: 30836 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19715

  11. Christian Kuhn uploaded patch set 6 02/16/18, 15:56

  12. TYPO3com voted on patch set 6 V +1 02/16/18, 16:06 Completed build in 09m 34s on Fri, 16 Feb, 05:06 PM Test Summary: 30836 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19721

  13. Christian Kuhn updated the commit message in patch set 7 02/16/18, 16:13

  14. TYPO3com voted on patch set 7 V +1 02/16/18, 16:21 Completed build in 07m 20s on Fri, 16 Feb, 05:21 PM Test Summary: 30836 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19724

  15. Christian Kuhn uploaded patch set 8 02/16/18, 17:16

  16. TYPO3com voted on patch set 8 V -1 02/16/18, 17:17 Completed build in 11s on Fri, 16 Feb, 06:17 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19727

  17. Christian Kuhn uploaded patch set 9 02/16/18, 17:19

  18. TYPO3com voted on patch set 9 V -1 02/16/18, 17:27 Completed build in 08m 04s on Fri, 16 Feb, 06:27 PM Test Summary: 1 of 30993 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19728

  19. TYPO3com voted on patch set 9 V +1 02/16/18, 17:29 Completed build in 17m 50s on Fri, 16 Feb, 06:29 PM Test Summary: 30836 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-19728

  20. Mathias Schreiber voted on patch set 9 V +1 CR +1 02/16/18, 17:51

  21. Anja Leichsenring voted on patch set 9 V +1 CR +1 02/16/18, 18:54

  22. Benjamin Kott voted on patch set 9 V +1 CR +1 02/16/18, 19:02

  23. Christian Kuhn voted on patch set 9 V +2 CR +2 02/16/18, 19:04

  24. Christian Kuhn merged patch set 10 02/16/18, 19:04

  25. Benjamin Franzke commented on patch set 10 02/16/18, 20:15

    Unfortunately I am a bit late to the party (post merge): The ajax responses _all_ need to use JsonResponse, not HtmlResponse as the RequestHandler previously added application/json Content-Type by default. eID scripts did not have a default Content-Type header at all. Here's a patch that adresses that: https://review.typo3.org/c/55766/