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