Issue Bug Closed

#98417Extbase with empty htmlResponse incompatible signature

Michael Voehringer 09/22/22, 11:51 updated 11/08/22, 12:34

Description

Whenever an action did not need to return content of the content ist empty, PHP 8.1 reports a type miss match.

<?php

use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

class ExampleController extends ActionController
{ 
   public function exampleAction(): ResponseInterface
    { 
        return $this->htmlResponse();
    }
}
(1/1) TypeError
TYPO3\CMS\Core\Http\StreamFactory::createStream(): Argument #1 ($content) must be of type string, null given, called in /var/www/html/private/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php on line 1092

Reviews 5