Skip to content

Commit 85d9b5a

Browse files
authored
Fix deprecation warning for parameters implicitly marked as nullable (#92)
1 parent be639a9 commit 85d9b5a

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/Driver/ParallelDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class ParallelDriver implements Driver
2121
/**
2222
* @param Pool|null $pool
2323
*/
24-
public function __construct(Pool $pool = null)
24+
public function __construct(?Pool $pool = null)
2525
{
2626
$this->pool = $pool ?: Worker\pool();
2727
}

src/FilesystemException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class FilesystemException extends \Exception
66
{
7-
public function __construct(string $message, \Throwable $previous = null)
7+
public function __construct(string $message, ?\Throwable $previous = null)
88
{
99
parent::__construct($message, 0, $previous);
1010
}

src/Internal/Cache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class Cache
2020
* collected.
2121
* @param int|null $maxSize The maximum size of cache array (number of elements).
2222
*/
23-
public function __construct(int $gcInterval = 1000, int $maxSize = null)
23+
public function __construct(int $gcInterval = 1000, ?int $maxSize = null)
2424
{
2525
// By using a shared state object we're able to use `__destruct()` for "normal" garbage collection of both this
2626
// instance and the loop's watcher. Otherwise this object could only be GC'd when the TTL watcher was cancelled
@@ -89,7 +89,7 @@ public function get(string $key)
8989
return $this->sharedState->cache[$key];
9090
}
9191

92-
public function set(string $key, $value, int $ttl = null): void
92+
public function set(string $key, $value, ?int $ttl = null): void
9393
{
9494
if ($ttl === null) {
9595
unset($this->sharedState->cacheTimeouts[$key]);

src/Internal/FileTask.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ private static function makeId(int $id): string
3636
*
3737
* @throws \Error
3838
*/
39-
public function __construct(string $operation, array $args = [], int $id = null)
39+
public function __construct(string $operation, array $args = [], ?int $id = null)
4040
{
4141
if ($operation === '') {
4242
throw new \Error('Operation must be a non-empty string');

src/PendingOperationError.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ final class PendingOperationError extends \Error
77
public function __construct(
88
string $message = "The previous file operation must complete before another can be started",
99
int $code = 0,
10-
\Throwable $previous = null
10+
?\Throwable $previous = null
1111
) {
1212
parent::__construct($message, $code, $previous);
1313
}

0 commit comments

Comments
 (0)