Code beautification

This commit is contained in:
Alex Bilbie 2012-10-05 15:24:59 +01:00
parent ac3743027b
commit ddfb355280

View File

@ -121,18 +121,23 @@ class Server
{ {
$accessToken = null; $accessToken = null;
$_SERVER['REQUEST_METHOD'] = isset($_SERVER['REQUEST_METHOD']) ?
$_SERVER['REQUEST_METHOD'] = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : null; $_SERVER['REQUEST_METHOD'] :
null;
// Try and get the access token via an access_token or oauth_token parameter // Try and get the access token via an access_token or oauth_token parameter
switch ($_SERVER['REQUEST_METHOD']) switch ($_SERVER['REQUEST_METHOD'])
{ {
case 'POST': case 'POST':
$accessToken = isset($_POST[$this->_config['token_key']]) ? $_POST[$this->_config['token_key']] : null; $accessToken = isset($_POST[$this->_config['token_key']]) ?
$_POST[$this->_config['token_key']] :
null;
break; break;
default: default:
$accessToken = isset($_GET[$this->_config['token_key']]) ? $_GET[$this->_config['token_key']] : null; $accessToken = isset($_GET[$this->_config['token_key']]) ?
$_GET[$this->_config['token_key']] :
null;
break; break;
} }
@ -161,7 +166,8 @@ class Server
} else { } else {
if ( ! array_key_exists('id', $result) || ! array_key_exists('owner_id', $result) || if ( ! array_key_exists('id', $result) ||
! array_key_exists('owner_id', $result) ||
! array_key_exists('owner_type', $result)) { ! array_key_exists('owner_type', $result)) {
throw new ServerException($this->errors['missing_access_token_details']); throw new ServerException($this->errors['missing_access_token_details']);
} }