From a4d4773e01f0d68549c75871e18e2b42ca2188da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sun, 30 Jun 2024 23:45:57 +0200 Subject: [PATCH] Improve PHP 8.4+ support by avoiding implicitly nullable types --- composer.json | 8 ++++---- src/Io/Factory.php | 2 +- src/RedisClient.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 007b36f..f2d104f 100644 --- a/composer.json +++ b/composer.json @@ -12,16 +12,16 @@ ], "require": { "php": ">=7.1", - "clue/redis-protocol": "0.3.*", + "clue/redis-protocol": "^0.3.2", "evenement/evenement": "^3.0 || ^2.0 || ^1.0", "react/event-loop": "^1.2", - "react/promise": "^3", - "react/socket": "^1.15" + "react/promise": "^3.2", + "react/socket": "^1.16" }, "require-dev": { "phpstan/phpstan": "1.10.15 || 1.4.10", "phpunit/phpunit": "^9.6 || ^7.5", - "react/async": "^4.2 || ^3.2" + "react/async": "^4.3 || ^3.2" }, "autoload": { "psr-4": { diff --git a/src/Io/Factory.php b/src/Io/Factory.php index 196ee0d..d920fd6 100644 --- a/src/Io/Factory.php +++ b/src/Io/Factory.php @@ -27,7 +27,7 @@ class Factory * @param ?ConnectorInterface $connector * @param ?ProtocolFactory $protocol */ - public function __construct(ConnectorInterface $connector = null, ProtocolFactory $protocol = null) + public function __construct(?ConnectorInterface $connector = null, ?ProtocolFactory $protocol = null) { $this->connector = $connector ?: new Connector(); $this->protocol = $protocol ?: new ProtocolFactory(); diff --git a/src/RedisClient.php b/src/RedisClient.php index 1710d11..8f984b0 100644 --- a/src/RedisClient.php +++ b/src/RedisClient.php @@ -54,7 +54,7 @@ class RedisClient extends EventEmitter /** @var array */ private $psubscribed = []; - public function __construct(string $url, ConnectorInterface $connector = null) + public function __construct(string $url, ?ConnectorInterface $connector = null) { $args = []; \parse_str((string) \parse_url($url, \PHP_URL_QUERY), $args);