PSR fixes

This commit is contained in:
Alex Bilbie 2012-12-23 21:39:42 +00:00
parent df85c98e53
commit 38c50c00b0

View File

@ -25,18 +25,15 @@ class OAuthdb implements Database
public function validateClient($clientId, $clientSecret = null, $redirectUri = null) public function validateClient($clientId, $clientSecret = null, $redirectUri = null)
{ {
if ($clientId !== $this->clients[0]['client_id']) if ($clientId !== $this->clients[0]['client_id']) {
{
return false; return false;
} }
if ($clientSecret !== null && $clientSecret !== $this->clients[0]['client_secret']) if ($clientSecret !== null && $clientSecret !== $this->clients[0]['client_secret']) {
{
return false; return false;
} }
if ($redirectUri !== null && $redirectUri !== $this->clients[0]['redirect_uri']) if ($redirectUri !== null && $redirectUri !== $this->clients[0]['redirect_uri']) {
{
return false; return false;
} }
@ -78,8 +75,7 @@ class OAuthdb implements Database
public function deleteSession($clientId, $type, $typeId) public function deleteSession($clientId, $type, $typeId)
{ {
$key = $clientId . ':' . $type . ':' . $typeId; $key = $clientId . ':' . $type . ':' . $typeId;
if (isset($this->sessions_client_type_id[$key])) if (isset($this->sessions_client_type_id[$key])) {
{
unset($this->sessions[$this->sessions_client_type_id[$key]]); unset($this->sessions[$this->sessions_client_type_id[$key]]);
} }
return true; return true;
@ -89,8 +85,7 @@ class OAuthdb implements Database
{ {
$key = $clientId . ':' . $redirectUri . ':' . $authCode; $key = $clientId . ':' . $redirectUri . ':' . $authCode;
if (isset($this->sessions_code[$key])) if (isset($this->sessions_code[$key])) {
{
return $this->sessions[$this->sessions_code[$key]]; return $this->sessions[$this->sessions_code[$key]];
} }
@ -112,18 +107,14 @@ class OAuthdb implements Database
die('not implemented removeAuthCode'); die('not implemented removeAuthCode');
} }
public function setAccessToken( public function setAccessToken($sessionId, $accessToken)
$sessionId,
$accessToken
)
{ {
die('not implemented setAccessToken'); die('not implemented setAccessToken');
} }
public function addSessionScope($sessionId, $scope) public function addSessionScope($sessionId, $scope)
{ {
if ( ! isset($this->session_scopes[$sessionId])) if ( ! isset($this->session_scopes[$sessionId])) {
{
$this->session_scopes[$sessionId] = array(); $this->session_scopes[$sessionId] = array();
} }
@ -134,8 +125,7 @@ class OAuthdb implements Database
public function getScope($scope) public function getScope($scope)
{ {
if ( ! isset($this->scopes[$scope])) if ( ! isset($this->scopes[$scope])) {
{
return false; return false;
} }