Skip to content

Commit afcded8

Browse files
authored
Merge pull request #9 from pavog/php-84
PHP 8.4 compatability: Make parameter types explicitly nullable
2 parents 6e817e6 + c2d0a20 commit afcded8

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/EtcdLock.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class EtcdLock extends Lock implements LockInterface
2525
* @throws InvalidResponseStatusCodeException
2626
* @throws TooManySaveRetriesException
2727
*/
28-
public function __construct(string $key, bool $exclusive = false, int $time = 120, int $wait = 300, string $identifier = null)
28+
public function __construct(string $key, bool $exclusive = false, int $time = 120, int $wait = 300, ?string $identifier = null)
2929
{
3030
parent::__construct($key);
3131
$this->lock($exclusive, $time, $wait, $identifier);

src/Lock.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public function __construct(string $key)
262262
* @throws InvalidResponseStatusCodeException
263263
* @throws TooManySaveRetriesException
264264
*/
265-
public function lock(bool $exclusive = false, int $time = 120, int $wait = 300, string $identifier = null): bool
265+
public function lock(bool $exclusive = false, int $time = 120, int $wait = 300, ?string $identifier = null): bool
266266
{
267267
$this->exclusive = $exclusive;
268268
$this->time = $time;

src/LockInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface LockInterface
1818
* @param int $wait
1919
* @param string|null $identifier
2020
*/
21-
public function __construct(string $key, bool $exclusive = false, int $time = 60, int $wait = 300, string $identifier = null);
21+
public function __construct(string $key, bool $exclusive = false, int $time = 60, int $wait = 300, ?string $identifier = null);
2222

2323
/**
2424
* Check if is locked and returns time until lock runs out or false

0 commit comments

Comments
 (0)