From 8877a64bd38b48f3b171562354406bcdebe577b4 Mon Sep 17 00:00:00 2001 From: Thorsten Merz Date: Thu, 24 Mar 2022 15:45:32 +0100 Subject: [PATCH] Fixed missing nullable type hint --- .gitignore | 1 + src/HttpChannel.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 30babff..6ec4473 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /vendor/ .idea +*.iml composer.lock diff --git a/src/HttpChannel.php b/src/HttpChannel.php index f86b1e9..8be8de8 100644 --- a/src/HttpChannel.php +++ b/src/HttpChannel.php @@ -86,7 +86,7 @@ class HttpChannel extends Channel * * @var HttpChannel */ - protected static HttpChannel $prototype; + protected static ?HttpChannel $prototype = null; /** * Constructor @@ -259,10 +259,10 @@ public static function prototype() : self * * @param string $url URL * @param string $method HTTP Method (see self::METHOD_* consts) - * @param string|null $body Body (string or array) + * @param string|array null $body Body (string or array) * @param string|null $contentType Content-Type */ - public static function create(string $url, string $method = self::METHOD_GET, string $body = null, string $contentType = null): self + public static function create(string $url, string $method = self::METHOD_GET, $body = null, string $contentType = null): self { $httpChan = clone(self::prototype()); $httpChan->setURL($url);