Skip to content

Commit

Permalink
fix: dynamic property $signedOut
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JohnVillalovos committed May 23, 2024
1 parent 3d7205e commit 1545a7b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion WebServices/AuthenticationWebService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 1545a7b

Please sign in to comment.