Skip to content
Snippets Groups Projects
Commit e487cf52 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] Create own response instance in controller actions

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.

Change-Id: Icce283b3c19be14ef1adeec761cfd63c90ab24c5
Resolves: #83939
Releases: master
Reviewed-on: https://review.typo3.org/55754


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarMathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: default avatarMathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: default avatarBenjamin Kott <benjamin.kott@outlook.com>
Tested-by: default avatarBenjamin Kott <benjamin.kott@outlook.com>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 2b6a19ea
Branches
Tags
No related merge requests found
Showing
with 169 additions and 247 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment