diff --git a/lib/private/Http/Client/Client.php b/lib/private/Http/Client/Client.php index 4697f2e038..4e6843d7b9 100644 --- a/lib/private/Http/Client/Client.php +++ b/lib/private/Http/Client/Client.php @@ -1,4 +1,5 @@ config->getSystemValue('proxy', null); $proxyUserPwd = $this->config->getSystemValue('proxyuserpwd', null); $proxyUri = ''; @@ -130,10 +132,10 @@ class Client implements IClient { * 'verify' => true, // bool or string to CA file * 'debug' => true, * 'timeout' => 5, - * @return Response + * @return IResponse * @throws \Exception If the request could not get completed */ - public function get($uri, array $options = []) { + public function get(string $uri, array $options = []): IResponse { $this->setDefaultOptions(); $response = $this->client->get($uri, $options); $isStream = isset($options['stream']) && $options['stream']; @@ -161,10 +163,10 @@ class Client implements IClient { * 'verify' => true, // bool or string to CA file * 'debug' => true, * 'timeout' => 5, - * @return Response + * @return IResponse * @throws \Exception If the request could not get completed */ - public function head($uri, $options = []) { + public function head(string $uri, array $options = []): IResponse { $this->setDefaultOptions(); $response = $this->client->head($uri, $options); return new Response($response); @@ -196,10 +198,10 @@ class Client implements IClient { * 'verify' => true, // bool or string to CA file * 'debug' => true, * 'timeout' => 5, - * @return Response + * @return IResponse * @throws \Exception If the request could not get completed */ - public function post($uri, array $options = []) { + public function post(string $uri, array $options = []): IResponse { $this->setDefaultOptions(); $response = $this->client->post($uri, $options); return new Response($response); @@ -231,10 +233,10 @@ class Client implements IClient { * 'verify' => true, // bool or string to CA file * 'debug' => true, * 'timeout' => 5, - * @return Response + * @return IResponse * @throws \Exception If the request could not get completed */ - public function put($uri, array $options = []) { + public function put(string $uri, array $options = []): IResponse { $this->setDefaultOptions(); $response = $this->client->put($uri, $options); return new Response($response); @@ -266,10 +268,10 @@ class Client implements IClient { * 'verify' => true, // bool or string to CA file * 'debug' => true, * 'timeout' => 5, - * @return Response + * @return IResponse * @throws \Exception If the request could not get completed */ - public function delete($uri, array $options = []) { + public function delete(string $uri, array $options = []): IResponse { $this->setDefaultOptions(); $response = $this->client->delete($uri, $options); return new Response($response); @@ -302,10 +304,10 @@ class Client implements IClient { * 'verify' => true, // bool or string to CA file * 'debug' => true, * 'timeout' => 5, - * @return Response + * @return IResponse * @throws \Exception If the request could not get completed */ - public function options($uri, array $options = []) { + public function options(string $uri, array $options = []): IResponse { $this->setDefaultOptions(); $response = $this->client->options($uri, $options); return new Response($response); diff --git a/lib/private/Http/Client/ClientService.php b/lib/private/Http/Client/ClientService.php index 108ffa709c..1df54010a2 100644 --- a/lib/private/Http/Client/ClientService.php +++ b/lib/private/Http/Client/ClientService.php @@ -1,4 +1,5 @@ config, $this->certificateManager, new GuzzleClient()); } } diff --git a/lib/private/Http/Client/Response.php b/lib/private/Http/Client/Response.php index 48885de9f3..0ce6cc98e0 100644 --- a/lib/private/Http/Client/Response.php +++ b/lib/private/Http/Client/Response.php @@ -1,4 +1,5 @@ response->getStatusCode(); } /** - * @param $key + * @param string $key * @return string */ - public function getHeader($key) { + public function getHeader(string $key): string { return $this->response->getHeader($key); } /** * @return array */ - public function getHeaders() { + public function getHeaders(): array { return $this->response->getHeaders(); } } diff --git a/lib/public/Http/Client/IClient.php b/lib/public/Http/Client/IClient.php index 49e679a7ad..50addc230e 100644 --- a/lib/public/Http/Client/IClient.php +++ b/lib/public/Http/Client/IClient.php @@ -1,4 +1,5 @@