Skip to content

Commit b8b0d5b

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent 1ab4253 commit b8b0d5b

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

Lock.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class Lock implements SharedLockInterface, LoggerAwareInterface
3939
* @param float|null $ttl Maximum expected lock duration in seconds
4040
* @param bool $autoRelease Whether to automatically release the lock or not when the lock instance is destroyed
4141
*/
42-
public function __construct(Key $key, PersistingStoreInterface $store, float $ttl = null, bool $autoRelease = true)
42+
public function __construct(Key $key, PersistingStoreInterface $store, ?float $ttl = null, bool $autoRelease = true)
4343
{
4444
$this->store = $store;
4545
$this->key = $key;
@@ -191,7 +191,7 @@ public function acquireRead(bool $blocking = false): bool
191191
/**
192192
* {@inheritdoc}
193193
*/
194-
public function refresh(float $ttl = null)
194+
public function refresh(?float $ttl = null)
195195
{
196196
if (null === $ttl) {
197197
$ttl = $this->ttl;

LockInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function acquire(bool $blocking = false);
4141
* @throws LockConflictedException If the lock is acquired by someone else
4242
* @throws LockAcquiringException If the lock cannot be refreshed
4343
*/
44-
public function refresh(float $ttl = null);
44+
public function refresh(?float $ttl = null);
4545

4646
/**
4747
* Returns whether or not the lock is acquired.

NoLock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function acquire(bool $blocking = false): bool
2626
return true;
2727
}
2828

29-
public function refresh(float $ttl = null)
29+
public function refresh(?float $ttl = null)
3030
{
3131
}
3232

Store/FlockStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class FlockStore implements BlockingStoreInterface, SharedLockStoreInterface
3737
*
3838
* @throws LockStorageException If the lock directory doesn’t exist or is not writable
3939
*/
40-
public function __construct(string $lockPath = null)
40+
public function __construct(?string $lockPath = null)
4141
{
4242
if (null === $lockPath) {
4343
$lockPath = sys_get_temp_dir();

Tests/Store/DoctrineDbalStoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function testAbortAfterExpiration()
8181
/**
8282
* @dataProvider provideDsnWithSQLite
8383
*/
84-
public function testDsnWithSQLite(string $dsn, string $file = null)
84+
public function testDsnWithSQLite(string $dsn, ?string $file = null)
8585
{
8686
$key = new Key(uniqid(__METHOD__, true));
8787

Tests/Store/PdoDbalStoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function testConfigureSchema()
9494
/**
9595
* @dataProvider provideDsn
9696
*/
97-
public function testDsn(string $dsn, string $file = null)
97+
public function testDsn(string $dsn, ?string $file = null)
9898
{
9999
$this->expectDeprecation('Since symfony/lock 5.4: Usage of a DBAL Connection with "Symfony\Component\Lock\Store\PdoStore" is deprecated and will be removed in symfony 6.0. Use "Symfony\Component\Lock\Store\DoctrineDbalStore" instead.');
100100
$key = new Key(uniqid(__METHOD__, true));

Tests/Store/PdoStoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function testInvalidTtlConstruct()
7878
/**
7979
* @dataProvider provideDsnWithSQLite
8080
*/
81-
public function testDsnWithSQLite(string $dsn, string $file = null)
81+
public function testDsnWithSQLite(string $dsn, ?string $file = null)
8282
{
8383
$key = new Key(uniqid(__METHOD__, true));
8484

0 commit comments

Comments
 (0)