Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.4 compatability: Make parameter types explicitly nullable #9

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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;
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
Loading