diff --git a/composer.json b/composer.json index 29a80aa..a9a1bf8 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "spryng/rest-api-php", + "name": "janforth/rest-api-php", "description": "Implementation of the REST API in PHP", "type": "library", "license": "BSD-2-Clause", @@ -21,7 +21,10 @@ }, "autoload": { "psr-4": { - "Spryng\\SpryngRestApi\\": "src/Spryng/SpryngRestApi" + "Spryng\\SpryngRestApi\\": "src/" } - } + }, + "require": { + "php": ">=8.1" + } } diff --git a/src/Spryng/SpryngRestApi/Http/HttpClient.php b/src/Spryng/SpryngRestApi/Http/HttpClient.php index c7d2b87..cdea02c 100644 --- a/src/Spryng/SpryngRestApi/Http/HttpClient.php +++ b/src/Spryng/SpryngRestApi/Http/HttpClient.php @@ -24,7 +24,7 @@ class HttpClient implements HttpClientInterface */ protected $lastResponse; - public function __construct(Request $req = null) + public function __construct(Request|null $req = null) { $this->ch = curl_init(); @@ -34,7 +34,7 @@ public function __construct(Request $req = null) } } - public function send(Request $req = null) + public function send(Request|null $req = null) { if ($req === null) { if ($this->activeRequest === null) { @@ -99,7 +99,7 @@ private function executeWithData() * @param Request $req * @return HttpClientInterface */ - public function setActiveRequest(Request $req) + public function setActiveRequest(Request|null $req) { $this->activeRequest = $req; diff --git a/src/Spryng/SpryngRestApi/Http/HttpClientInterface.php b/src/Spryng/SpryngRestApi/Http/HttpClientInterface.php index 6944672..58df264 100644 --- a/src/Spryng/SpryngRestApi/Http/HttpClientInterface.php +++ b/src/Spryng/SpryngRestApi/Http/HttpClientInterface.php @@ -13,18 +13,18 @@ public function __construct(Request $req = null); /** * Executes the currently active request or $req if it is set. * - * @param Request $req + * @param Request|null $req * @return Response */ - public function send(Request $req = null); + public function send(Request|null $req = null); /** * Sets the current request to be activated to $req * - * @param Request $req + * @param Request|null $req * @return HttpClientInterface */ - public function setActiveRequest(Request $req); + public function setActiveRequest(Request|null $req); /** * Returns the lastResponse of the last request that was send.