From 78551b08595b4e530c83902e658cdf288296d7fd Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Mon, 16 Jul 2012 16:47:54 +0100 Subject: [PATCH] Added parameter doc blocks --- src/oauth2server/DatabaseInterface.php | 93 +++++++++++++++++++++++--- 1 file changed, 85 insertions(+), 8 deletions(-) diff --git a/src/oauth2server/DatabaseInterface.php b/src/oauth2server/DatabaseInterface.php index acf96f97..2bc70808 100644 --- a/src/oauth2server/DatabaseInterface.php +++ b/src/oauth2server/DatabaseInterface.php @@ -4,12 +4,30 @@ namespace oauth2server; interface DatabaseInteface { + /** + * [validateClient description] + * @param string $clientId The client's ID + * @param string $clientSecret The client's secret (default = "null") + * @param string $redirectUri The client's redirect URI (default = "null") + * @return [type] [description] + */ public function validateClient( $clientId, $clientSecret = null, $redirectUri = null ); + /** + * [newSession description] + * @param string $clientId The client ID + * @param string $redirectUri The redirect URI + * @param string $type The session owner's type (default = "user") + * @param string $typeId The session owner's ID (default = "null") + * @param string $authCode The authorisation code (default = "null") + * @param string $accessToken The access token (default = "null") + * @param string $stage The stage of the session (default ="request") + * @return [type] [description] + */ public function newSession( $clientId, $redirectUri, @@ -20,6 +38,16 @@ interface DatabaseInteface $stage = 'request' ); + /** + * [updateSession description] + * @param string $clientId The client ID + * @param string $type The session owner's type (default = "user") + * @param string $typeId The session owner's ID (default = "null") + * @param string $authCode The authorisation code (default = "null") + * @param string $accessToken The access token (default = "null") + * @param string $stage The stage of the session (default ="request") + * @return [type] [description] + */ public function updateSession( $clientId, $type = 'user', @@ -29,12 +57,26 @@ interface DatabaseInteface $stage ); + /** + * [deleteSession description] + * @param string $clientId The client ID + * @param string $type The session owner's type + * @param string $typeId The session owner's ID + * @return [type] [description] + */ public function deleteSession( $clientId, $type, $typeId ); + /** + * [validateAuthCode description] + * @param string $clientId The client ID + * @param string $redirectUri The redirect URI + * @param string $authCode The authorisation code + * @return [type] [description] + */ public function validateAuthCode( $clientId, $redirectUri, @@ -42,39 +84,74 @@ interface DatabaseInteface ); /** - * Has access token - * - * Check if an access token exists for a user (or an application) - * - * @access public - * @return bool|Return FALSE is a token doesn't exist or return the - * access token as a string + * [hasAccessToken description] + * @param string $type The session owner's type + * @param string $typeId The session owner's ID + * @param string $clientId The client ID + * @return boolean [description] */ public function hasAccessToken( + $type, $typeId, $clientId ); + /** + * [getAccessToken description] + * @param int $sessionId The OAuth session ID + * @return [type] [description] + */ public function getAccessToken($sessionId); + /** + * [removeAuthCode description] + * @param int $sessionId The OAuth session ID + * @return [type] [description] + */ public function removeAuthCode($sessionId); + /** + * [setAccessToken description] + * @param int $sessionId The OAuth session ID + * @param string $accessToken The access token + */ public function setAccessToken( - $sessionId, + int $sessionId, $accessToken ); + /** + * [addSessionScope description] + * @param int $sessionId [description] + * @param string $scope [description] + */ public function addSessionScope( $sessionId, $scope ); + /** + * [getScope description] + * @param string $scope [description] + * @return [type] [description] + */ public function getScope($scope); + /** + * [updateSessionScopeAccessToken description] + * @param int $sesstionId [description] + * @param string $accessToken [description] + * @return [type] [description] + */ public function updateSessionScopeAccessToken( $sesstionId, $accessToken ); + /** + * [accessTokenScopes description] + * @param string $accessToken [description] + * @return [type] [description] + */ public function accessTokenScopes($accessToken); } \ No newline at end of file