From 36998c95b06c5ebddf0a720cef72ca1984674b76 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Thu, 21 Mar 2024 15:26:14 +0100 Subject: [PATCH] Fix implicitly nullable params --- src/Factory/StreamFactory.php | 4 ++-- tests/bootstrap.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Factory/StreamFactory.php b/src/Factory/StreamFactory.php index 31d99b5..04d22a1 100644 --- a/src/Factory/StreamFactory.php +++ b/src/Factory/StreamFactory.php @@ -51,7 +51,7 @@ public function createStream(string $content = ''): StreamInterface public function createStreamFromFile( string $filename, string $mode = 'r', - StreamInterface $cache = null + ?StreamInterface $cache = null ): StreamInterface { set_error_handler( static function (int $errno, string $errstr) use ($filename, $mode): void { @@ -82,7 +82,7 @@ static function (int $errno, string $errstr) use ($filename, $mode): void { /** * {@inheritdoc} */ - public function createStreamFromResource($resource, StreamInterface $cache = null): StreamInterface + public function createStreamFromResource($resource, ?StreamInterface $cache = null): StreamInterface { if (!is_resource($resource)) { throw new InvalidArgumentException( diff --git a/tests/bootstrap.php b/tests/bootstrap.php index dbe4a90..eee5637 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -29,7 +29,7 @@ } ], Message::class => [ - 'header' => function (string $string, bool $replace = true, int $statusCode = null): void { + 'header' => function (string $string, bool $replace = true, ?int $statusCode = null): void { HeaderStack::push( [ 'header' => $string,