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);