Skip to content

Commit

Permalink
add a ? to implicitly nullable parameter types to make them explicitl…
Browse files Browse the repository at this point in the history
…y nullable
  • Loading branch information
pavog committed Dec 12, 2024
1 parent a1d9c49 commit c2d0a20
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 @@ -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

0 comments on commit c2d0a20

Please sign in to comment.