91599[FEATURE] Add convenience ResponseFactory methods
Commit message
Review
-
Code review CR 0
-
Verified V 0
- core-ci +1 CI
Issues 1
Files 11
- typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php+6 −5
- typo3/sysext/backend/Classes/Controller/FormInlineAjaxController.php+6 −5
- typo3/sysext/backend/Classes/Controller/RecordListDownloadController.php+4 −13
- typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php+6 −5
- typo3/sysext/backend/Classes/Security/ContentSecurityPolicy/CspAjaxController.php+13 −13
- typo3/sysext/backend/Tests/Unit/Controller/FormInlineAjaxControllerTest.php+10 −9
- typo3/sysext/core/Classes/Http/ResponseFactory.php+159 −1
- typo3/sysext/core/Documentation/Changelog/14.2/Feature-108645-AddConvenienceResponseFactoryMethods.rstnew+100 −0
- typo3/sysext/core/Tests/Unit/Http/ResponseFactoryTest.php+243 −0
- typo3/sysext/lowlevel/Classes/Controller/QuerySearchController.php+14 −9
- typo3/sysext/lowlevel/Tests/Functional/Controller/QuerySearchControllerTest.php+3 −0
Review log 1318
-
Benni Mack uploaded patch set 1 11/12/25, 21:17
-
Benni Mack marked it work in progress 11/12/25, 21:17
-
core-ci voted on patch set 1 V -1 11/12/25, 21:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/89400
-
Benni Mack uploaded patch set 2
V -101/15/26, 12:03 -
core-ci voted on patch set 2 V -1 01/15/26, 12:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/93509
-
Benni Mack uploaded patch set 3
V -101/15/26, 15:58 -
Benni Mack marked it ready for review 01/15/26, 16:01
-
core-ci voted on patch set 3 V +1 01/15/26, 16:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/93529
-
Simon Schaufelberger commented on patch set 3 02/04/26, 22:33
-
Benni Mack commented on patch set 4
V +102/05/26, 08:03Published edit on patch set 3. -
core-ci voted on patch set 4 V -1 02/05/26, 08:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95109
-
Simon Schaufelberger commented on patch set 4 CR +1 V +1 02/05/26, 10:02
Feature-108645-AddConvenienceResponseFactoryMethods.rst:1ReplyDone -
Simon Schaufelberger commented on patch set 4 CR 0 V 0 02/05/26, 10:03
Unresolved
Something with the rst file is not correct. -
Benni Mack rebased onto patch set 5
V -102/07/26, 11:48 -
core-ci voted on patch set 5 V +1 02/07/26, 11:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95381
-
Benjamin Franzke commented on patch set 5 02/07/26, 14:57
Looking at the file/download methods this is more of a response generator/builder than a response factory. How about we name it `ResponseBuilder` (or simply `Responder`), let it use `ResponseFactory` (via ResponseFactoryInterface) internally for all response generations (instead of using all the `FooResponse` classes directly), in order to actually prepare for PSR-7 interchangeability? -
Benjamin Franzke commented on patch set 5 02/07/26, 15:06
Reply Unresolved
Basically something like: ``` final readonly class Responder { public function __construct( private ResponseFactoryInterface $responseFactory, private StreamFactoryInterface $streamFactory, ) {} public function json( object|array|null $data = [], int $status = 200, ?string $contentType = null, int $encodingOptions = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_UNESCAPED_SLASHES, ): ResponseInterface { $contentType ??= 'application/json; charset=utf-8'; return $this->responseFactory ->createResponse($status) ->withHeader('Content-Type', 'application/json; charset=utf-8') ->withBody($this->streamFactory->createStream((string)json_encode($data))); } public function html( string $content, int $status = 200, ?string $contentType = null ): ResponseInterface { $contentType ??= 'text/html; charset=utf-8'; return $this->responseFactory ->createResponse($status) ->withHeader('Content-Type', $contentType) ->withBody($this->streamFactory->createStream($content)); } ``` This allows to switch the `ResponseFactoryInterface` implemenetation later on. -
Benni Mack abandoned the change 04/21/26, 14:47
won't do this DX change
Feature-108645-AddConvenienceResponseFactoryMethods.rst:1