From 95068c5176dae54fd49b565f0d1f2534d1f7e2f7 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Mon, 6 Aug 2012 14:42:58 +0100 Subject: [PATCH] Lots of fixes following errors found from unit tests --- src/Oauth2/Authentication/Server.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Oauth2/Authentication/Server.php b/src/Oauth2/Authentication/Server.php index 67fc4e86..1e6ee1f5 100644 --- a/src/Oauth2/Authentication/Server.php +++ b/src/Oauth2/Authentication/Server.php @@ -197,7 +197,7 @@ class Server foreach ($scopes as $scope) { $scopeDetails = $this->dbcall('getScope', $scope); - + //die(var_dump($scopeDetails)); if ($scopeDetails === false) { throw new OAuthServerClientException(sprintf($this->errors['invalid_scope'], $scope), 4); @@ -504,11 +504,15 @@ class Server throw new OAuthServerException('No registered database abstractor'); } + if ( ! $this->db instanceof Database) { + throw new OAuthServerException('Registered database abstractor is not an instance of Oauth2\Authentication\Database'); + } + $args = func_get_args(); $method = $args[0]; - unset ($args[0]); - $params = $args; + unset($args[0]); + $params = array_values($args); - return call_user_func(array($this, $method), $args); + return call_user_func_array(array($this->db, $method), $args); } }