From cbce5f45ba4f227e471f287c7a92de51df7c1528 Mon Sep 17 00:00:00 2001 From: Andrew Millington Date: Sun, 13 May 2018 17:38:07 +0100 Subject: [PATCH] Fix case for serverRequest variable and remove unused variable --- src/Exception/OAuthServerException.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Exception/OAuthServerException.php b/src/Exception/OAuthServerException.php index 72f23e6e..4713eba5 100644 --- a/src/Exception/OAuthServerException.php +++ b/src/Exception/OAuthServerException.php @@ -97,7 +97,7 @@ class OAuthServerException extends \Exception */ public function setServerRequest($serverRequest) { - $this->ServerRequest = $serverRequest; + $this->serverRequest = $serverRequest; } /** @@ -139,8 +139,6 @@ class OAuthServerException extends \Exception */ public static function invalidClient($serverRequest) { - $errorMessage = 'Client authentication failed'; - $exception = new static('Client authentication failed', 4, 'invalid_client', 401); $exception->setServerRequest($serverRequest); @@ -316,8 +314,8 @@ class OAuthServerException extends \Exception // include the "WWW-Authenticate" response header field // matching the authentication scheme used by the client. // @codeCoverageIgnoreStart - if ($this->errorType === 'invalid_client' && $this->ServerRequest->hasHeader('Authorization') === true) { - $authScheme = strpos($this->ServerRequest->getHeader('Authorization')[0], 'Bearer') === 0 ? 'Bearer' : 'Basic'; + if ($this->errorType === 'invalid_client' && $this->serverRequest->hasHeader('Authorization') === true) { + $authScheme = strpos($this->serverRequest->getHeader('Authorization')[0], 'Bearer') === 0 ? 'Bearer' : 'Basic'; $headers['WWW-Authenticate'] = $authScheme . ' realm="OAuth"'; }