From b53d71743492f2bb8dd1d1ed93898b3b26170d89 Mon Sep 17 00:00:00 2001 From: "Jan F. Orth" Date: Sun, 1 Jun 2025 18:19:03 +0200 Subject: [PATCH 1/3] Addressing "Implicitly marking parameter as nullable is deprecated, the explicit nullable type must be used instead" deprecation warning in PHP 8.4; PHP 8.0 minimum now required --- src/Spryng/SpryngRestApi/Http/HttpClient.php | 6 +++--- src/Spryng/SpryngRestApi/Http/HttpClientInterface.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) 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. From 56b42754409d996aeeefc32b5666528935c23ec0 Mon Sep 17 00:00:00 2001 From: "Jan F. Orth" Date: Sun, 24 Aug 2025 10:00:59 +0200 Subject: [PATCH 2/3] Addressing "Implicitly marking parameter as nullable is deprecated, the explicit nullable type must be used instead" deprecation warning in PHP 8.4; PHP 8.0 minimum now required --- composer.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 29a80aa..8c928d1 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" + "Janforth\\RestApi\\": "src/" } - } + }, + "require": { + "php": ">=8.1" + } } From 2504b967b7bfa5dbf4a6f6e04aa4ec7501e66ee7 Mon Sep 17 00:00:00 2001 From: "Jan F. Orth" Date: Sun, 24 Aug 2025 11:37:55 +0200 Subject: [PATCH 3/3] Addressing "Implicitly marking parameter as nullable is deprecated, the explicit nullable type must be used instead" deprecation warning in PHP 8.4; PHP 8.0 minimum now required --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8c928d1..a9a1bf8 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ }, "autoload": { "psr-4": { - "Janforth\\RestApi\\": "src/" + "Spryng\\SpryngRestApi\\": "src/" } }, "require": {