Changed variable syntax style to be PSR2

This commit is contained in:
Alex Bilbie 2013-05-05 18:05:46 +01:00
parent acfadc8993
commit 6897e233d4

View File

@ -163,15 +163,15 @@ class ResourceServer
*/ */
public function isValid() 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) { if ( ! $result) {
throw new Exception\InvalidAccessTokenException('Access token is not valid'); throw new Exception\InvalidAccessTokenException('Access token is not valid');
} }
$this->accessToken = $access_token; $this->accessToken = $accessToken;
$this->sessionId = $result['id']; $this->sessionId = $result['id'];
$this->ownerType = $result['owner_type']; $this->ownerType = $result['owner_type'];
$this->ownerId = $result['owner_id']; $this->ownerId = $result['owner_id'];
@ -215,17 +215,17 @@ class ResourceServer
protected function determineAccessToken() protected function determineAccessToken()
{ {
if ($header = $this->getRequest()->header('Authorization')) { if ($header = $this->getRequest()->header('Authorization')) {
$access_token = trim(str_replace('Bearer', '', $header)); $accessToken = trim(str_replace('Bearer', '', $header));
} else { } else {
$method = $this->getRequest()->server('REQUEST_METHOD'); $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'); throw new Exception\InvalidAccessTokenException('Access token is missing');
} }
return $access_token; return $accessToken;
} }
} }