Skip to content

Commit

Permalink
Merge pull request #9 from pavog/php-84
Browse files Browse the repository at this point in the history
PHP 8.4 compatability: Make parameter types explicitly nullable
  • Loading branch information
pavog authored Dec 13, 2024
2 parents 6e817e6 + c2d0a20 commit afcded8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/EtcdLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Lock.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,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;
Expand Down
2 changes: 1 addition & 1 deletion src/LockInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit afcded8

Please sign in to comment.