From 3fe38a0f48fde7889d7523e88288e2c714e4e26e Mon Sep 17 00:00:00 2001 From: 8ctopus Date: Mon, 25 Nov 2024 10:20:34 +0400 Subject: [PATCH] Fix php 8.4 deprecation notices (#6) --- src/ServerRequestCreator.php | 14 +++++++------- src/UploadedFileCreator.php | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ServerRequestCreator.php b/src/ServerRequestCreator.php index a52a2a7..92b2520 100644 --- a/src/ServerRequestCreator.php +++ b/src/ServerRequestCreator.php @@ -13,7 +13,7 @@ final class ServerRequestCreator * @param ServerNormalizerInterface|null $normalizer * @return ServerRequestInterface */ - public static function create(ServerNormalizerInterface $normalizer = null): ServerRequestInterface + public static function create(?ServerNormalizerInterface $normalizer = null): ServerRequestInterface { return self::createFromGlobals(null, null, null, null, null, $normalizer); } @@ -28,12 +28,12 @@ public static function create(ServerNormalizerInterface $normalizer = null): Ser * @return ServerRequestInterface */ public static function createFromGlobals( - array $server = null, - array $files = null, - array $cookie = null, - array $get = null, - array $post = null, - ServerNormalizerInterface $normalizer = null + ?array $server = null, + ?array $files = null, + ?array $cookie = null, + ?array $get = null, + ?array $post = null, + ?ServerNormalizerInterface $normalizer = null ): ServerRequestInterface { $server ??= $_SERVER; $normalizer ??= new SapiNormalizer(); diff --git a/src/UploadedFileCreator.php b/src/UploadedFileCreator.php index 86183b3..927ec4e 100644 --- a/src/UploadedFileCreator.php +++ b/src/UploadedFileCreator.php @@ -28,8 +28,8 @@ public static function create( $streamOrFile, int $size, int $error, - string $clientFilename = null, - string $clientMediaType = null + ?string $clientFilename = null, + ?string $clientMediaType = null ): UploadedFileInterface { return new UploadedFile($streamOrFile, $size, $error, $clientFilename, $clientMediaType); }