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 fea26e4dd..44254a819 100644 --- a/Exception/IOException.php +++ b/Exception/IOException.php @@ -22,7 +22,7 @@ class IOException extends \RuntimeException implements IOExceptionInterface { private $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 23192bc74..037629f18 100644 --- a/Filesystem.php +++ b/Filesystem.php @@ -132,7 +132,7 @@ public function exists($files) * * @throws IOException When touch fails */ - public function touch($files, int $time = null, int $atime = null) + public function touch($files, ?int $time = null, ?int $atime = null) { foreach ($this->toIterable($files) as $file) { if (!($time ? self::box('touch', $file, $time, $atime) : self::box('touch', $file))) { @@ -534,7 +534,7 @@ public function makePathRelative(string $endPath, string $startPath) * * @throws IOException When file type is unknown */ - public function mirror(string $originDir, string $targetDir, \Traversable $iterator = null, array $options = []) + public function mirror(string $originDir, string $targetDir, ?\Traversable $iterator = null, array $options = []) { $targetDir = rtrim($targetDir, '/\\'); $originDir = rtrim($originDir, '/\\'); diff --git a/Path.php b/Path.php index 9aa37355a..858e1623e 100644 --- a/Path.php +++ b/Path.php @@ -257,7 +257,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 '';