From 6019785974afe2415c84e0a45c4c2b7f92ced873 Mon Sep 17 00:00:00 2001 From: Xnopyt Date: Wed, 30 Jul 2025 20:23:59 +0100 Subject: [PATCH] Fix PHP 8.4 deprecation warnings --- src/Connection.php | 2 +- src/Connection/Socket.php | 2 +- src/Exception/BuriedException.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Connection.php b/src/Connection.php index 852d12c..c067acd 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -32,7 +32,7 @@ public function __construct( string $host, int $port = Socket::DEFAULT_PORT, array $options = [], - \Closure $createSocket = null + ?\Closure $createSocket = null ) { if (isset($createSocket)) { $this->socket = $createSocket($host, $port, $options); diff --git a/src/Connection/Socket.php b/src/Connection/Socket.php index dc43406..fd2c0b1 100644 --- a/src/Connection/Socket.php +++ b/src/Connection/Socket.php @@ -79,7 +79,7 @@ public function write(string $data): void } } - public function read(int $length = null): string + public function read(?int $length = null): string { $this->connect(); diff --git a/src/Exception/BuriedException.php b/src/Exception/BuriedException.php index f16f359..d35f0b0 100644 --- a/src/Exception/BuriedException.php +++ b/src/Exception/BuriedException.php @@ -13,7 +13,7 @@ public static function create(int $jobId): self private int $jobId; - public function __construct(int $jobId, string $message, int $code = 0, \Exception $previous = null) + public function __construct(int $jobId, string $message, int $code = 0, ?\Exception $previous = null) { $this->jobId = $jobId; parent::__construct($message, $code, $previous);