From 365e6e7f79e9a6289bba27b02c1d1908d0a48c64 Mon Sep 17 00:00:00 2001 From: Adam Bramley Date: Thu, 23 Jan 2025 13:27:27 +1100 Subject: [PATCH] Fix PHP 8.4 deprecations --- src/File.php | 4 ++-- src/Stream/ReadOnlyFile.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/File.php b/src/File.php index 89d4e36..bbb5c03 100644 --- a/src/File.php +++ b/src/File.php @@ -103,7 +103,7 @@ private function __construct() */ public static function checksum( string|ReadonlyFile $filePath, - Key $key = null, + ?Key $key = null, bool|string $encoding = Halite::ENCODE_BASE64URLSAFE ): string { if ($filePath instanceof ReadOnlyFile) { @@ -593,7 +593,7 @@ public static function verify( */ protected static function checksumData( StreamInterface $fileStream, - Key $key = null, + ?Key $key = null, string|bool $encoding = Halite::ENCODE_BASE64URLSAFE ): string { $config = self::getConfig( diff --git a/src/Stream/ReadOnlyFile.php b/src/Stream/ReadOnlyFile.php index a2bac8d..639e570 100644 --- a/src/Stream/ReadOnlyFile.php +++ b/src/Stream/ReadOnlyFile.php @@ -78,7 +78,7 @@ class ReadOnlyFile implements StreamInterface * @throws TypeError * @psalm-suppress RedundantConditionGivenDocblockType */ - public function __construct($file, Key $key = null) + public function __construct($file, ?Key $key = null) { if (is_string($file)) { if (!is_readable($file)) {