From c2d0a203eace1a498b714186c986a850a84fb6b4 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Thu, 12 Dec 2024 17:59:48 +0100 Subject: [PATCH] add a ? to implicitly nullable parameter types to make them explicitly nullable --- src/EtcdLock.php | 2 +- src/Lock.php | 2 +- src/LockInterface.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EtcdLock.php b/src/EtcdLock.php index 89f774f..17b735f 100644 --- a/src/EtcdLock.php +++ b/src/EtcdLock.php @@ -25,7 +25,7 @@ class EtcdLock extends Lock implements LockInterface * @throws InvalidResponseStatusCodeException * @throws TooManySaveRetriesException */ - public function __construct(string $key, bool $exclusive = false, int $time = 120, int $wait = 300, string $identifier = null) + public function __construct(string $key, bool $exclusive = false, int $time = 120, int $wait = 300, ?string $identifier = null) { parent::__construct($key); $this->lock($exclusive, $time, $wait, $identifier); diff --git a/src/Lock.php b/src/Lock.php index 456cb2e..a545eea 100644 --- a/src/Lock.php +++ b/src/Lock.php @@ -263,7 +263,7 @@ public function __construct(string $key) * @throws InvalidResponseStatusCodeException * @throws TooManySaveRetriesException */ - public function lock(bool $exclusive = false, int $time = 120, int $wait = 300, string $identifier = null): bool + public function lock(bool $exclusive = false, int $time = 120, int $wait = 300, ?string $identifier = null): bool { $this->exclusive = $exclusive; $this->time = $time; diff --git a/src/LockInterface.php b/src/LockInterface.php index 7f5e8b7..9beaba2 100644 --- a/src/LockInterface.php +++ b/src/LockInterface.php @@ -18,7 +18,7 @@ interface LockInterface * @param int $wait * @param string|null $identifier */ - public function __construct(string $key, bool $exclusive = false, int $time = 60, int $wait = 300, string $identifier = null); + public function __construct(string $key, bool $exclusive = false, int $time = 60, int $wait = 300, ?string $identifier = null); /** * Check if is locked and returns time until lock runs out or false