From 3d7205eac436c2b943c2c4988ee7d2a8a9053a9a Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Wed, 22 May 2024 18:54:59 -0700 Subject: [PATCH 1/2] fix: declare `ReservationControllerResult.requiresApproval` The attribute `ReservationControllerResult.requiresApproval` needs to be declared or PHP 8.2 will fail as dynamic attributes are deprecated. Closes: #242 --- WebServices/Controllers/ReservationSaveController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WebServices/Controllers/ReservationSaveController.php b/WebServices/Controllers/ReservationSaveController.php index 5927811d1..11ce855d1 100644 --- a/WebServices/Controllers/ReservationSaveController.php +++ b/WebServices/Controllers/ReservationSaveController.php @@ -288,6 +288,10 @@ class ReservationControllerResult * @var array|string[] */ private $errors = []; + /** + * @var bool + */ + private $requiresApproval; public function __construct($referenceNumber = null, $errors = [], $requiresApproval = false) { From 1545a7bc88e72879ddab1cfc2b21f82faa6d8362 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Wed, 22 May 2024 19:08:04 -0700 Subject: [PATCH 2/2] fix: dynamic property $signedOut A user reported an error: Creation of dynamic property RestResponse::$signedOut is deprecated File: /var/www/html/WebServices/AuthenticationWebService.php Resolved this by inheriting from `RestResponse`. Also declare the `$server` attribute on the `AuthenticationWebService` class. --- WebServices/AuthenticationWebService.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/WebServices/AuthenticationWebService.php b/WebServices/AuthenticationWebService.php index 49a7938a7..76f23de83 100644 --- a/WebServices/AuthenticationWebService.php +++ b/WebServices/AuthenticationWebService.php @@ -6,8 +6,21 @@ require_once(ROOT_DIR . 'WebServices/Requests/AuthenticationRequest.php'); require_once(ROOT_DIR . 'WebServices/Requests/SignOutRequest.php'); +class SignedOutResponse extends RestResponse +{ + /** + * @var bool; + */ + public $signedOut; +} + + class AuthenticationWebService { + /** + * @var IRestServer + */ + private $server; /** * @var IWebServiceAuthentication */ @@ -71,7 +84,7 @@ public function SignOut() Log::Debug('WebService SignOut for userId %s and sessionToken %s', $userId, $sessionToken); $this->authentication->Logout($userId, $sessionToken); - $r = new RestResponse(); + $r = new SignedOutResponse(); $r->signedOut = true; $this->server->WriteResponse($r); }