From 5a553607d4ffbfa9c0ab62facadea296c9db7086 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 23 Jan 2024 14:51:25 +0100 Subject: [PATCH] Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value --- Exception/FileNotFoundException.php | 2 +- Exception/IOException.php | 2 +- Filesystem.php | 4 ++-- Path.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Exception/FileNotFoundException.php b/Exception/FileNotFoundException.php index 48b6408095..06b732b168 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 fea26e4ddc..44254a819d 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 23192bc74c..037629f189 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 9aa37355a8..858e1623eb 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 '';