diff --git a/Exception/FileNotFoundException.php b/Exception/FileNotFoundException.php index 48b640809..06b732b16 100644 --- a/Exception/FileNotFoundException.php +++ b/Exception/FileNotFoundException.php @@ -19,7 +19,7 @@ */ class FileNotFoundException extends IOException { - public function __construct(string $message = null, int $code = 0, \Throwable $previous = null, string $path = null) + public function __construct(?string $message = null, int $code = 0, ?\Throwable $previous = null, ?string $path = null) { if (null === $message) { if (null === $path) { diff --git a/Exception/IOException.php b/Exception/IOException.php index a3c544553..df3a0850a 100644 --- a/Exception/IOException.php +++ b/Exception/IOException.php @@ -22,7 +22,7 @@ class IOException extends \RuntimeException implements IOExceptionInterface { private ?string $path; - public function __construct(string $message, int $code = 0, \Throwable $previous = null, string $path = null) + public function __construct(string $message, int $code = 0, ?\Throwable $previous = null, ?string $path = null) { $this->path = $path; diff --git a/Filesystem.php b/Filesystem.php index e8ba4958d..b7fc70118 100644 --- a/Filesystem.php +++ b/Filesystem.php @@ -125,7 +125,7 @@ public function exists(string|iterable $files): bool * * @throws IOException When touch fails */ - public function touch(string|iterable $files, int $time = null, int $atime = null): void + public function touch(string|iterable $files, ?int $time = null, ?int $atime = null): void { foreach ($this->toIterable($files) as $file) { if (!($time ? self::box('touch', $file, $time, $atime) : self::box('touch', $file))) { @@ -508,7 +508,7 @@ public function makePathRelative(string $endPath, string $startPath): string * * @throws IOException When file type is unknown */ - public function mirror(string $originDir, string $targetDir, \Traversable $iterator = null, array $options = []): void + public function mirror(string $originDir, string $targetDir, ?\Traversable $iterator = null, array $options = []): void { $targetDir = rtrim($targetDir, '/\\'); $originDir = rtrim($originDir, '/\\'); diff --git a/Path.php b/Path.php index 664396235..01b561724 100644 --- a/Path.php +++ b/Path.php @@ -254,7 +254,7 @@ public static function getRoot(string $path): string * @param string|null $extension if specified, only that extension is cut * off (may contain leading dot) */ - public static function getFilenameWithoutExtension(string $path, string $extension = null): string + public static function getFilenameWithoutExtension(string $path, ?string $extension = null): string { if ('' === $path) { return '';