Description
PHP 8.4 has been released for a few weeks now and I started to test upgrades in a project of mine where I use reactphp-redis. As of now it seems that the library is not compatible yet because of one deprecation: implicitly nullable parameter types are now deprecated and result in an ErrorException (see https://wiki.php.net/rfc/deprecate-implicitly-nullable-types).
Example in version 2.7 of reactphp-redis in file src/Factory.php:30:
/**
* @param ?LoopInterface $loop
* @param ?ConnectorInterface $connector
* @param ?ProtocolFactory $protocol
*/
public function __construct(LoopInterface $loop = null, ConnectorInterface $connector = null, ProtocolFactory $protocol = null)
{
$this->loop = $loop ?: Loop::get();
$this->connector = $connector ?: new Connector(array(), $this->loop);
$this->protocol = $protocol ?: new ProtocolFactory();
}
The parameters are marked as nullable in the doctype comment, but not the actual type declaration like e.g. function __construct(?LoopInterface $loop = null, ...
. This raises an error exception in PHP8.4 like this:
ErrorException: Clue\React\Redis\Factory::__construct(): Implicitly marking parameter $loop as nullable is deprecated, the explicit nullable type must be used instead in vendor/clue/redis-react/src/Factory.php:30
Any chance this still can get fixed in version 2.x? That would be great! Or do we just have to wait for version 3.x for PHP8.4? Thank you for your library! 😃