diff --git a/src/OAuth2/ResourceServer.php b/src/OAuth2/ResourceServer.php index 195f98ed..474b1635 100644 --- a/src/OAuth2/ResourceServer.php +++ b/src/OAuth2/ResourceServer.php @@ -163,15 +163,15 @@ class ResourceServer */ public function isValid() { - $access_token = $this->determineAccessToken(); + $accessToken = $this->determineAccessToken(); - $result = $this->storages['session']->validateAccessToken($access_token); + $result = $this->storages['session']->validateAccessToken($accessToken); if ( ! $result) { throw new Exception\InvalidAccessTokenException('Access token is not valid'); } - $this->accessToken = $access_token; + $this->accessToken = $accessToken; $this->sessionId = $result['id']; $this->ownerType = $result['owner_type']; $this->ownerId = $result['owner_id']; @@ -215,17 +215,17 @@ class ResourceServer protected function determineAccessToken() { if ($header = $this->getRequest()->header('Authorization')) { - $access_token = trim(str_replace('Bearer', '', $header)); + $accessToken = trim(str_replace('Bearer', '', $header)); } else { $method = $this->getRequest()->server('REQUEST_METHOD'); - $access_token = $this->getRequest()->{$method}($this->tokenKey); + $accessToken = $this->getRequest()->{$method}($this->tokenKey); } - if (empty($access_token)) { + if (empty($accessToken)) { throw new Exception\InvalidAccessTokenException('Access token is missing'); } - return $access_token; + return $accessToken; } }