mirror of
https://github.com/danog/file.git
synced 2024-11-30 04:19:39 +01:00
Fix implicit nullable parameters
This commit is contained in:
parent
6b82161f20
commit
72f6071616
@ -31,7 +31,7 @@ final class ParallelFilesystemDriver implements FilesystemDriver
|
||||
/**
|
||||
* @param int $workerLimit Maximum number of workers to use from the pool for open files.
|
||||
*/
|
||||
public function __construct(WorkerPool $pool = null, int $workerLimit = self::DEFAULT_WORKER_LIMIT)
|
||||
public function __construct(?WorkerPool $pool = null, int $workerLimit = self::DEFAULT_WORKER_LIMIT)
|
||||
{
|
||||
$this->pool = $pool ?? workerPool();
|
||||
$this->workerLimit = $workerLimit;
|
||||
|
@ -119,7 +119,7 @@ final class FileCache implements StringCache
|
||||
}
|
||||
}
|
||||
|
||||
public function set(string $key, string $value, int $ttl = null): void
|
||||
public function set(string $key, string $value, ?int $ttl = null): void
|
||||
{
|
||||
if ($ttl < 0) {
|
||||
throw new \Error("Invalid cache TTL ({$ttl}); integer >= 0 or null required");
|
||||
|
@ -4,7 +4,7 @@ namespace Amp\File;
|
||||
|
||||
class FilesystemException extends \Exception
|
||||
{
|
||||
public function __construct(string $message, \Throwable $previous = null)
|
||||
public function __construct(string $message, ?\Throwable $previous = null)
|
||||
{
|
||||
parent::__construct($message, 0, $previous);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user