diff --git a/composer.json b/composer.json index 2c23456..875ff35 100644 --- a/composer.json +++ b/composer.json @@ -10,13 +10,18 @@ "Basic Auth", "Client Certificate Auth" ], - "homepage": "http://chroma-x.de/", + "homepage": "https://chroma-x.de/", "license": "MIT", "authors": [ { "name": "Martin Brecht-Precht", "email": "mb@chroma-x.de", - "homepage": "http://chroma-x.de" + "homepage": "https://chroma-x.de" + }, + { + "name": "Andrius Baliutis", + "email": "ab@chroma-x.de", + "homepage": "https://chroma-x.de" } ], "autoload": { @@ -25,10 +30,10 @@ } }, "require": { - "php": "^7.1 || ^8.3", + "php": "^8.3", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", - "chroma-x/basic-http-client": "~3.0" + "chroma-x/basic-http-client": "~4.0" } } diff --git a/src/JsonHttpClient.php b/src/JsonHttpClient.php index c16a989..89d35b1 100644 --- a/src/JsonHttpClient.php +++ b/src/JsonHttpClient.php @@ -1,5 +1,7 @@ setUrl($url); } - /** - * @return RequestInterface - */ public function getRequest(): RequestInterface { return $this->request; @@ -61,11 +52,8 @@ public function getRequest(): RequestInterface /** * @param string[] $queryParameters - * @return ResponseInterface - * @throws NetworkException - * @throws ConnectionTimeoutException */ - public function get(array $queryParameters = array()): ResponseInterface + public function get(array $queryParameters = []): ResponseInterface { $this->request ->setMethod(RequestInterface::REQUEST_METHOD_GET) @@ -77,11 +65,8 @@ public function get(array $queryParameters = array()): ResponseInterface /** * @param string[] $queryParameters - * @return ResponseInterface - * @throws NetworkException - * @throws ConnectionTimeoutException */ - public function head(array $queryParameters = array()): ResponseInterface + public function head(array $queryParameters = []): ResponseInterface { $this->request ->setMethod(RequestInterface::REQUEST_METHOD_HEAD) @@ -91,13 +76,7 @@ public function head(array $queryParameters = array()): ResponseInterface return $this->request->getResponse(); } - /** - * @param array $postData - * @return ResponseInterface - * @throws NetworkException - * @throws ConnectionTimeoutException - */ - public function post(array $postData = array()): ResponseInterface + public function post(array $postData = []): ResponseInterface { $this->request ->getMessage() @@ -108,13 +87,7 @@ public function post(array $postData = array()): ResponseInterface return $this->request->getResponse(); } - /** - * @param array $putData - * @return ResponseInterface - * @throws NetworkException - * @throws ConnectionTimeoutException - */ - public function put(array $putData = array()): ResponseInterface + public function put(array $putData = []): ResponseInterface { $this->request ->getMessage() @@ -125,13 +98,7 @@ public function put(array $putData = array()): ResponseInterface return $this->request->getResponse(); } - /** - * @param array $patchData - * @return ResponseInterface - * @throws NetworkException - * @throws ConnectionTimeoutException - */ - public function patch(array $patchData = array()): ResponseInterface + public function patch(array $patchData = []): ResponseInterface { $this->request ->getMessage() @@ -142,13 +109,7 @@ public function patch(array $patchData = array()): ResponseInterface return $this->request->getResponse(); } - /** - * @param string[] $queryParameters - * @return ResponseInterface - * @throws NetworkException - * @throws ConnectionTimeoutException - */ - public function delete(array $queryParameters = array()): ResponseInterface + public function delete(array $queryParameters = []): ResponseInterface { $this->request ->setMethod(RequestInterface::REQUEST_METHOD_DELETE) diff --git a/src/Request/JsonRequest.php b/src/Request/JsonRequest.php index 8209905..af98971 100644 --- a/src/Request/JsonRequest.php +++ b/src/Request/JsonRequest.php @@ -1,5 +1,7 @@ bodyData = $bodyData; } - /** - * @param resource $curl - * @return $this - * @throws HttpRequestMessageException - */ - public function configureCurl($curl) + public function configureCurl(\CurlHandle $curl): self { $jsonBody = json_encode($this->bodyData); if ($jsonBody === false) { diff --git a/src/Response/JsonResponse.php b/src/Response/JsonResponse.php index b53ca49..c739004 100644 --- a/src/Response/JsonResponse.php +++ b/src/Response/JsonResponse.php @@ -1,5 +1,7 @@ getStatusCode() === 204) { parent::setBody(null); @@ -31,10 +28,7 @@ protected function setBody($body) parent::setBody($body); return $this; } - - /** - * @return array - */ + public function getBody(): array { return parent::getBody();