Added parameter doc blocks

This commit is contained in:
Alex Bilbie 2012-07-16 16:47:54 +01:00
parent d5f0ac479b
commit 78551b0859

View File

@ -4,12 +4,30 @@ namespace oauth2server;
interface DatabaseInteface 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( public function validateClient(
$clientId, $clientId,
$clientSecret = null, $clientSecret = null,
$redirectUri = 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( public function newSession(
$clientId, $clientId,
$redirectUri, $redirectUri,
@ -20,6 +38,16 @@ interface DatabaseInteface
$stage = 'request' $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( public function updateSession(
$clientId, $clientId,
$type = 'user', $type = 'user',
@ -29,12 +57,26 @@ interface DatabaseInteface
$stage $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( public function deleteSession(
$clientId, $clientId,
$type, $type,
$typeId $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( public function validateAuthCode(
$clientId, $clientId,
$redirectUri, $redirectUri,
@ -42,39 +84,74 @@ interface DatabaseInteface
); );
/** /**
* Has access token * [hasAccessToken description]
* * @param string $type The session owner's type
* Check if an access token exists for a user (or an application) * @param string $typeId The session owner's ID
* * @param string $clientId The client ID
* @access public * @return boolean [description]
* @return bool|Return FALSE is a token doesn't exist or return the
* access token as a string
*/ */
public function hasAccessToken( public function hasAccessToken(
$type,
$typeId, $typeId,
$clientId $clientId
); );
/**
* [getAccessToken description]
* @param int $sessionId The OAuth session ID
* @return [type] [description]
*/
public function getAccessToken($sessionId); public function getAccessToken($sessionId);
/**
* [removeAuthCode description]
* @param int $sessionId The OAuth session ID
* @return [type] [description]
*/
public function removeAuthCode($sessionId); public function removeAuthCode($sessionId);
/**
* [setAccessToken description]
* @param int $sessionId The OAuth session ID
* @param string $accessToken The access token
*/
public function setAccessToken( public function setAccessToken(
$sessionId, int $sessionId,
$accessToken $accessToken
); );
/**
* [addSessionScope description]
* @param int $sessionId [description]
* @param string $scope [description]
*/
public function addSessionScope( public function addSessionScope(
$sessionId, $sessionId,
$scope $scope
); );
/**
* [getScope description]
* @param string $scope [description]
* @return [type] [description]
*/
public function getScope($scope); public function getScope($scope);
/**
* [updateSessionScopeAccessToken description]
* @param int $sesstionId [description]
* @param string $accessToken [description]
* @return [type] [description]
*/
public function updateSessionScopeAccessToken( public function updateSessionScopeAccessToken(
$sesstionId, $sesstionId,
$accessToken $accessToken
); );
/**
* [accessTokenScopes description]
* @param string $accessToken [description]
* @return [type] [description]
*/
public function accessTokenScopes($accessToken); public function accessTokenScopes($accessToken);
} }