From e3b191732d0119b978467f271b59de23416c0ad7 Mon Sep 17 00:00:00 2001 From: Sascha Ploss Date: Thu, 1 Sep 2022 17:56:40 +0200 Subject: [PATCH] Fixes Deprecation in PHP 8.1 when RestException without message is created Exception::__construct(): Passing null to parameter #1 ($message) of type string is deprecated See also https://3v4l.org/CNRAR --- src/RestException.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/RestException.php b/src/RestException.php index 429138166..d38cc9627 100644 --- a/src/RestException.php +++ b/src/RestException.php @@ -86,6 +86,9 @@ public function __construct($httpStatusCode, $errorMessage = null, array $detail $this->stage = $previous ? $events[count($events)-2] : end($events); } $this->details = $details; + if (is_null($errorMessage)) { + $errorMessage = ''; + } parent::__construct($errorMessage, $httpStatusCode, $previous); }