diff --git a/src/Context/InfoContext.php b/src/Context/InfoContext.php index 7d85e38..fc4c6d1 100644 --- a/src/Context/InfoContext.php +++ b/src/Context/InfoContext.php @@ -14,7 +14,7 @@ public function __construct(ResponseInterface $response) $this->response = $response; } - public function getInfo(string $type = null): mixed + public function getInfo(?string $type = null): mixed { return $this->response->getInfo($type); } diff --git a/src/Context/InfoContextInterface.php b/src/Context/InfoContextInterface.php index 273c59a..c301b62 100644 --- a/src/Context/InfoContextInterface.php +++ b/src/Context/InfoContextInterface.php @@ -5,6 +5,6 @@ interface InfoContextInterface { - public function getInfo(string $type = null): mixed; + public function getInfo(?string $type = null): mixed; } diff --git a/src/LoggableHttpClient.php b/src/LoggableHttpClient.php index 71aab3e..f64339a 100644 --- a/src/LoggableHttpClient.php +++ b/src/LoggableHttpClient.php @@ -73,7 +73,7 @@ public function request(string $method, string $url, array $options = []): Respo /** * @param LoggableResponse|iterable $responses */ - public function stream(ResponseInterface|iterable $responses, float $timeout = null): ResponseStreamInterface + public function stream(ResponseInterface|iterable $responses, ?float $timeout = null): ResponseStreamInterface { if ($responses instanceof LoggableResponse) { $responses = [$responses]; diff --git a/src/Response/LoggableResponse.php b/src/Response/LoggableResponse.php index 9be3506..957bc69 100644 --- a/src/Response/LoggableResponse.php +++ b/src/Response/LoggableResponse.php @@ -142,7 +142,7 @@ public function cancel(): void $this->logResponseContent(); } - public function getInfo(string $type = null): mixed + public function getInfo(?string $type = null): mixed { if (null !== $type) { return $this->info[$type] ?? $this->response->getInfo($type);