From 7eb8322d71dbaefb59617b8a0c650016e14ff711 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 1 May 2019 20:59:26 +0200 Subject: [PATCH] Fix typehint --- Message/HeaderAbstract.php | 2 +- Message/Http/Rest.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Message/HeaderAbstract.php b/Message/HeaderAbstract.php index 03ee5de6c..c361c6303 100644 --- a/Message/HeaderAbstract.php +++ b/Message/HeaderAbstract.php @@ -213,7 +213,7 @@ abstract class HeaderAbstract * * @since 1.0.0 */ - abstract public function get(string $key) : array; + abstract public function get(string $key = null) : array; /** * Header has key? diff --git a/Message/Http/Rest.php b/Message/Http/Rest.php index 36201ff79..2a798ae41 100644 --- a/Message/Http/Rest.php +++ b/Message/Http/Rest.php @@ -30,7 +30,7 @@ final class Rest * * @param Request $request Request * - * @return string Returns the request result + * @return Request Returns the request result * * @throws \Exception this exception is thrown if an internal curl_init error occurs * @@ -51,7 +51,7 @@ final class Rest $headers[$key] = $key . ': ' . \implode('', $header); } - curl_setopt($curl, \CURLOPT_HTTPHEADER, $headers); + \curl_setopt($curl, \CURLOPT_HTTPHEADER, $headers); \curl_setopt($curl, \CURLOPT_HEADER, true); switch ($request->getMethod()) { @@ -82,7 +82,7 @@ final class Rest $cHeaderString = ''; $response = new Response(); - curl_setopt($curl, \CURLOPT_HEADERFUNCTION, + \curl_setopt($curl, \CURLOPT_HEADERFUNCTION, function($curl, $header) use ($response, &$cHeaderString) { $cHeaderString .= $header;