This commit is contained in:
Romain Neutron
2012-04-26 00:55:53 +02:00
parent edbfff226e
commit ade22295ad
631 changed files with 92375 additions and 101763 deletions

View File

@@ -22,160 +22,158 @@
*/
class API_OAuth2_Exception_Exception extends Exception implements API_OAuth2_Exception_Interface
{
/**
*
* @var int
*/
protected $http_code;
/**
*
* @var int
*/
protected $http_code;
/**
*
* @var string
*/
protected $error;
/**
*
* @var string
*/
protected $error;
/**
*
* @var string
*/
protected $error_description;
/**
*
* @var string
*/
protected $error_description;
/**
*
* @var string
*/
protected $error_uri;
/**
*
* @var string
*/
protected $error_uri;
/**
*
* @var string
*/
protected $scope;
/**
*
* @var string
*/
protected $scope;
/**
*
* @param int $http_code
* @param string $error
* @param string $error_description
* @param string $scope
* @param string $error_uri
* @return API_OAuth2_Exception_Exception
*/
public function __construct($http_code, $error, $error_description = null, $scope = null, $error_uri = null)
{
$this->error = $error;
$this->error_description = $error_description;
$this->scope = $scope;
$this->error_uri = $error_uri;
parent::__construct();
/**
*
* @param int $http_code
* @param string $error
* @param string $error_description
* @param string $scope
* @param string $error_uri
* @return API_OAuth2_Exception_Exception
*/
public function __construct($http_code, $error, $error_description = null, $scope = null, $error_uri = null)
{
$this->error = $error;
$this->error_description = $error_description;
$this->scope = $scope;
$this->error_uri = $error_uri;
parent::__construct();
return $this;
}
return $this;
}
/**
*
* @return int
*/
public function getHttp_code()
{
return $this->http_code;
}
/**
*
* @return int
*/
public function getHttp_code()
{
return $this->http_code;
}
/**
*
* @param int $http_code
* @return API_OAuth2_Exception_Exception
*/
public function setHttp_code($http_code)
{
$this->http_code = $http_code;
/**
*
* @param int $http_code
* @return API_OAuth2_Exception_Exception
*/
public function setHttp_code($http_code)
{
$this->http_code = $http_code;
return $this;
}
return $this;
}
/**
*
* @return string
*/
public function getError()
{
return $this->error;
}
/**
*
* @return string
*/
public function getError()
{
return $this->error;
}
/**
*
* @param string $scope
* @return API_OAuth2_Exception_Exception
*/
public function setError($error)
{
$this->error = $error;
/**
*
* @param string $scope
* @return API_OAuth2_Exception_Exception
*/
public function setError($error)
{
$this->error = $error;
return $this;
}
return $this;
}
/**
*
* @return string
*/
public function getError_description()
{
return $this->error_description;
}
/**
*
* @return string
*/
public function getError_description()
{
return $this->error_description;
}
/**
*
* @param string $scope
* @return API_OAuth2_Exception_Exception
*/
public function setError_description($error_description)
{
$this->error_description = $error_description;
/**
*
* @param string $scope
* @return API_OAuth2_Exception_Exception
*/
public function setError_description($error_description)
{
$this->error_description = $error_description;
return $this;
}
return $this;
}
/**
*
* @return string
*/
public function getError_uri()
{
return $this->error_uri;
}
/**
*
* @return string
*/
public function getError_uri()
{
return $this->error_uri;
}
/**
*
* @param string $scope
* @return API_OAuth2_Exception_Exception
*/
public function setError_uri($error_uri)
{
$this->error_uri = $error_uri;
/**
*
* @param string $scope
* @return API_OAuth2_Exception_Exception
*/
public function setError_uri($error_uri)
{
$this->error_uri = $error_uri;
return $this;
}
return $this;
}
/**
*
* @return string
*/
public function getScope()
{
return $this->scope;
}
/**
*
* @return string
*/
public function getScope()
{
return $this->scope;
}
/**
*
* @param string $scope
* @return API_OAuth2_Exception_Exception
*/
public function setScope($scope)
{
$this->scope = $scope;
return $this;
}
/**
*
* @param string $scope
* @return API_OAuth2_Exception_Exception
*/
public function setScope($scope)
{
$this->scope = $scope;
return $this;
}
}

View File

@@ -23,11 +23,11 @@
interface API_OAuth2_Exception_Interface
{
public function getError();
public function getError();
public function getHttp_code();
public function getHttp_code();
public function getError_description();
public function getError_description();
public function getError_uri();
public function getError_uri();
}

View File

@@ -22,81 +22,81 @@
*/
class API_OAuth2_Exception_Redirect extends API_OAuth2_Exception_Exception
{
/**
*
* @var int
*/
protected $http_code = 302;
/**
*
* @var int
*/
protected $http_code = 302;
/**
*
* @var string
*/
protected $state;
/**
*
* @var string
*/
protected $redirect_uri;
/**
*
* @var string
*/
protected $state;
/**
*
* @param string $redirect_uri
* @param string $error
* @param string $error_description
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect
*/
public function __construct($redirect_uri, $error, $error_description = null, $state = null, $error_uri = null)
{
$this->redirect_uri = $redirect_uri;
$this->state = $state;
parent::__construct($this->http_code, $error, $error_description, $error_uri);
/**
*
* @var string
*/
protected $redirect_uri;
return $this;
}
/**
*
* @param string $redirect_uri
* @param string $error
* @param string $error_description
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect
*/
public function __construct($redirect_uri, $error, $error_description = null, $state = null, $error_uri = null)
{
$this->redirect_uri = $redirect_uri;
$this->state = $state;
parent::__construct($this->http_code, $error, $error_description, $error_uri);
/**
*
* @return string
*/
public function getState()
{
return $this->state;
}
return $this;
}
/**
*
* @param string $redirect_uri
* @return API_OAuth2_Exception_Redirect
*/
public function setState($state)
{
$this->state = $state;
/**
*
* @return string
*/
public function getState()
{
return $this->state;
}
return $this;
}
/**
*
* @param string $redirect_uri
* @return API_OAuth2_Exception_Redirect
*/
public function setState($state)
{
$this->state = $state;
/**
*
* @return string
*/
public function getRedirect_uri()
{
return $this->redirect_uri;
}
return $this;
}
/**
*
* @param string $redirect_uri
* @return API_OAuth2_Exception_Redirect
*/
public function setRedirect_uri($redirect_uri)
{
$this->redirect_uri = $redirect_uri;
/**
*
* @return string
*/
public function getRedirect_uri()
{
return $this->redirect_uri;
}
return $this;
}
/**
*
* @param string $redirect_uri
* @return API_OAuth2_Exception_Redirect
*/
public function setRedirect_uri($redirect_uri)
{
$this->redirect_uri = $redirect_uri;
return $this;
}
}

View File

@@ -22,31 +22,29 @@
*/
class API_OAuth2_Exception_Redirect_AccessDenied extends API_OAuth2_Exception_Redirect
{
/**
*
* @var string
*/
protected $error = 'access_denied';
/**
*
* @var string
*/
protected $error = 'access_denied';
/**
*
* @var string
*/
protected $error_description = " The resource owner or authorization server denied the request.";
/**
*
* @var string
*/
protected $error_description = " The resource owner or authorization server denied the request.";
/**
*
* @param string $redirect_uri
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect_AccessDenied
*/
public function __construct($redirect_uri, $state = null, $error_uri = null)
{
parent::__construct($redirect_uri, $this->error, $this->error_description, $state, $error_uri);
return $this;
}
/**
*
* @param string $redirect_uri
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect_AccessDenied
*/
public function __construct($redirect_uri, $state = null, $error_uri = null)
{
parent::__construct($redirect_uri, $this->error, $this->error_description, $state, $error_uri);
return $this;
}
}

View File

@@ -22,31 +22,29 @@
*/
class API_OAuth2_Exception_Redirect_InvalidClient extends API_OAuth2_Exception_Redirect
{
/**
*
* @var string
*/
protected $error = 'invalid_Client';
/**
*
* @var string
*/
protected $error = 'invalid_Client';
/**
*
* @var string
*/
protected $error_description = "The Client id is not valid.";
/**
*
* @var string
*/
protected $error_description = "The Client id is not valid.";
/**
*
* @param string $redirect_uri
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect_InvalidClient
*/
public function __construct($redirect_uri, $state = null, $error_uri = null)
{
parent::__construct($redirect_uri, $this->error, $this->error_description, $state, $error_uri);
return $this;
}
/**
*
* @param string $redirect_uri
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect_InvalidClient
*/
public function __construct($redirect_uri, $state = null, $error_uri = null)
{
parent::__construct($redirect_uri, $this->error, $this->error_description, $state, $error_uri);
return $this;
}
}

View File

@@ -22,31 +22,29 @@
*/
class API_OAuth2_Exception_Redirect_InvalidRequest extends API_OAuth2_Exception_Redirect
{
/**
*
* @var string
*/
protected $error = 'invalid_request';
/**
*
* @var string
*/
protected $error = 'invalid_request';
/**
*
* @var string
*/
protected $error_description = "The request is missing a required parameter, includes an unsupported parameter or parameter value, repeats the same parameter, uses more than one method for including an access token, or is otherwise malformed.";
/**
*
* @var string
*/
protected $error_description = "The request is missing a required parameter, includes an unsupported parameter or parameter value, repeats the same parameter, uses more than one method for including an access token, or is otherwise malformed.";
/**
*
* @param string $redirect_uri
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect_InvalidRequest
*/
public function __construct($redirect_uri, $state = null, $error_uri = null)
{
parent::__construct($redirect_uri, $this->error, $this->error_description, $state, $error_uri);
return $this;
}
/**
*
* @param string $redirect_uri
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect_InvalidRequest
*/
public function __construct($redirect_uri, $state = null, $error_uri = null)
{
parent::__construct($redirect_uri, $this->error, $this->error_description, $state, $error_uri);
return $this;
}
}

View File

@@ -22,60 +22,58 @@
*/
class API_OAuth2_Exception_Redirect_InvalidScope extends API_OAuth2_Exception_Redirect
{
/**
*
* @var string
*/
protected $error = 'invalid_scope';
/**
*
* @var string
*/
protected $error = 'invalid_scope';
/**
*
* @var string
*/
protected $error_description = "The requested scope is invalid, unknown, or malformed.";
/**
*
* @var string
*/
protected $error_description = "The requested scope is invalid, unknown, or malformed.";
/**
*
* @var string
*/
protected $scope;
/**
*
* @var string
*/
protected $scope;
/**
*
* @param string $redirect_uri
* @param string $scope
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect_InvalidScope
*/
public function __construct($redirect_uri, $scope, $state = null, $error_uri = null)
{
$this->scope = $scope;
parent::__construct($redirect_uri, $this->error, $this->error_description, $state, $error_uri);
/**
*
* @param string $redirect_uri
* @param string $scope
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect_InvalidScope
*/
public function __construct($redirect_uri, $scope, $state = null, $error_uri = null)
{
$this->scope = $scope;
parent::__construct($redirect_uri, $this->error, $this->error_description, $state, $error_uri);
return $this;
}
return $this;
}
/**
*
* @var string
*/
public function getScope()
{
return $this->scope;
}
/**
*
* @var string
*/
public function getScope()
{
return $this->scope;
}
/**
*
* @param string $scope
* @return API_OAuth2_Exception_Redirect_InvalidScope
*/
public function setScope($scope)
{
$this->scope = $scope;
return $this;
}
/**
*
* @param string $scope
* @return API_OAuth2_Exception_Redirect_InvalidScope
*/
public function setScope($scope)
{
$this->scope = $scope;
return $this;
}
}

View File

@@ -22,29 +22,29 @@
*/
class API_OAuth2_Exception_Redirect_ServerError extends API_OAuth2_Exception_Redirect
{
/**
*
* @var string
*/
protected $error = 'server_error';
/**
*
* @var string
*/
protected $error = 'server_error';
/**
*
* @var string
*/
protected $error_description = "The authorization server encountered an unexpected condition which prevented it from fulfilling the request.";
/**
*
* @var string
*/
protected $error_description = "The authorization server encountered an unexpected condition which prevented it from fulfilling the request.";
/**
*
* @param string $redirect_uri
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect_ServerError
*/
public function __construct($redirect_uri, $state = null, $error_uri = null)
{
parent::__construct($redirect_uri, $this->error, $this->error_description, $state, $error_uri);
/**
*
* @param string $redirect_uri
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect_ServerError
*/
public function __construct($redirect_uri, $state = null, $error_uri = null)
{
parent::__construct($redirect_uri, $this->error, $this->error_description, $state, $error_uri);
return $this;
}
return $this;
}
}

View File

@@ -22,31 +22,29 @@
*/
class API_OAuth2_Exception_Redirect_Unauthorized extends API_OAuth2_Exception_Redirect
{
/**
*
* @var string
*/
protected $error = 'temporarily_unavailable';
/**
*
* @var string
*/
protected $error = 'temporarily_unavailable';
/**
*
* @var string
*/
protected $error_description = "The authorization server is currently unable to handle the request due to a temporary overloading or maintenance of the server.";
/**
*
* @var string
*/
protected $error_description = "The authorization server is currently unable to handle the request due to a temporary overloading or maintenance of the server.";
/**
*
* @param string $redirect_uri
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect_Unauthorized
*/
public function __construct($redirect_uri, $state = null, $error_uri = null)
{
parent::__construct($redirect_uri, $this->error, $this->error_description, $state, $error_uri);
return $this;
}
/**
*
* @param string $redirect_uri
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect_Unauthorized
*/
public function __construct($redirect_uri, $state = null, $error_uri = null)
{
parent::__construct($redirect_uri, $this->error, $this->error_description, $state, $error_uri);
return $this;
}
}

View File

@@ -22,31 +22,29 @@
*/
class API_OAuth2_Exception_Redirect_UnauthorizedClient extends API_OAuth2_Exception_Redirect
{
/**
*
* @var string
*/
protected $error = 'unauthorized_client';
/**
*
* @var string
*/
protected $error = 'unauthorized_client';
/**
*
* @var string
*/
protected $error_description = "The client is not authorized to request an authorization code using this method.";
/**
*
* @var string
*/
protected $error_description = "The client is not authorized to request an authorization code using this method.";
/**
*
* @param string $redirect_uri
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect_UnauthorizedClient
*/
public function __construct($redirect_uri, $state = null, $error_uri = null)
{
parent::__construct($redirect_uri, $this->error, $this->error_description, $state, $error_uri);
return $this;
}
/**
*
* @param string $redirect_uri
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect_UnauthorizedClient
*/
public function __construct($redirect_uri, $state = null, $error_uri = null)
{
parent::__construct($redirect_uri, $this->error, $this->error_description, $state, $error_uri);
return $this;
}
}

View File

@@ -22,60 +22,58 @@
*/
class API_OAuth2_Exception_Redirect_UnsupportedResponseType extends API_OAuth2_Exception_Redirect
{
/**
*
* @var string
*/
protected $error = 'unsupported_response_type';
/**
*
* @var string
*/
protected $error = 'unsupported_response_type';
/**
*
* @var string
*/
protected $error_description = "The authorization server does not support obtaining an authorization code using this method.";
/**
*
* @var string
*/
protected $error_description = "The authorization server does not support obtaining an authorization code using this method.";
/**
*
* @var string
*/
protected $method;
/**
*
* @var string
*/
protected $method;
/**
*
* @param string $redirect_uri
* @param string $method
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect_UnsupportedResponseType
*/
public function __construct($redirect_uri, $method, $state = null, $error_uri = null)
{
$this->method = $method;
parent::__construct($redirect_uri, $this->error, $this->error_description, $state, $error_uri);
/**
*
* @param string $redirect_uri
* @param string $method
* @param string $state
* @param string $error_uri
* @return API_OAuth2_Exception_Redirect_UnsupportedResponseType
*/
public function __construct($redirect_uri, $method, $state = null, $error_uri = null)
{
$this->method = $method;
parent::__construct($redirect_uri, $this->error, $this->error_description, $state, $error_uri);
return $this;
}
return $this;
}
/**
*
* @var string
*/
public function getMethod()
{
return $this->method;
}
/**
*
* @var string
*/
public function getMethod()
{
return $this->method;
}
/**
*
* @param string $method
* @return API_OAuth2_Exception_Redirect_UnsupportedResponseType
*/
public function setMethod($method)
{
$this->method = $method;
return $this;
}
/**
*
* @param string $method
* @return API_OAuth2_Exception_Redirect_UnsupportedResponseType
*/
public function setMethod($method)
{
$this->method = $method;
return $this;
}
}

View File

@@ -22,58 +22,56 @@
*/
class API_OAuth2_Exception_WWWAuthenticate extends API_OAuth2_Exception_Exception
{
/**
*
* @var string
*/
protected $realm;
/**
*
* @var string
*/
protected $realm;
/**
*
* @var string
*/
protected $scope;
/**
*
* @var string
*/
protected $scope;
/**
*
* @param int $http_code
* @param string $realm
* @param string $error
* @param string $error_description
* @param string $error_uri
* @param string $scope
* @return API_OAuth2_Exception_WWWAuthenticate
*/
public function __construct($http_code, $realm, $error, $error_description = null, $error_uri = null, $scope = null)
{
$this->realm = $realm;
$this->scope = $scope;
/**
*
* @param int $http_code
* @param string $realm
* @param string $error
* @param string $error_description
* @param string $error_uri
* @param string $scope
* @return API_OAuth2_Exception_WWWAuthenticate
*/
public function __construct($http_code, $realm, $error, $error_description = null, $error_uri = null, $scope = null)
{
$this->realm = $realm;
$this->scope = $scope;
parent::__construct($http_code, $error, $error_description, $error_uri);
parent::__construct($http_code, $error, $error_description, $error_uri);
return $this;
}
return $this;
}
/**
*
* @return string
*/
public function getRealm()
{
return $this->realm;
}
/**
*
* @return string
*/
public function getRealm()
{
return $this->realm;
}
/**
*
* @param string $realm
* @return API_OAuth2_Exception_WWWAuthenticate
*/
public function setRealm($realm)
{
$this->realm = $realm;
return $this;
}
/**
*
* @param string $realm
* @return API_OAuth2_Exception_WWWAuthenticate
*/
public function setRealm($realm)
{
$this->realm = $realm;
return $this;
}
}

View File

@@ -22,31 +22,29 @@
*/
class API_OAuth2_Exception_WWWAuthenticate_ExpiredToken extends API_OAuth2_Exception_WWWAuthenticate_Type_Unauthorized
{
/**
*
* @var string
*/
protected $error = 'expired_token';
/**
*
* @var string
*/
protected $error = 'expired_token';
/**
*
* @var string
*/
protected $error_description = "The access token provided has expired.";
/**
*
* @var string
*/
protected $error_description = "The access token provided has expired.";
/**
*
* @param string $realm
* @param string $scope
* @param string $error_uri
* @return API_OAuth2_Exception_WWWAuthenticate_ExpiredToken
*/
public function __construct($realm, $scope = null, $error_uri = null)
{
parent::__construct($realm, $this->error, $this->error_description, $error_uri, $scope);
return $this;
}
/**
*
* @param string $realm
* @param string $scope
* @param string $error_uri
* @return API_OAuth2_Exception_WWWAuthenticate_ExpiredToken
*/
public function __construct($realm, $scope = null, $error_uri = null)
{
parent::__construct($realm, $this->error, $this->error_description, $error_uri, $scope);
return $this;
}
}

View File

@@ -22,31 +22,29 @@
*/
class API_OAuth2_Exception_WWWAuthenticate_InsufficientScope extends API_OAuth2_Exception_WWWAuthenticate_Type_Forbidden
{
/**
*
* @var string
*/
protected $error = 'insufficient_scope';
/**
*
* @var string
*/
protected $error = 'insufficient_scope';
/**
*
* @var string
*/
protected $error_description = "The request requires higher privileges than provided by the access token.";
/**
*
* @var string
*/
protected $error_description = "The request requires higher privileges than provided by the access token.";
/**
*
* @param string $realm
* @param string $scope
* @param string $error_uri
* @return API_OAuth2_Exception_WWWAuthenticate_InsufficientScope
*/
public function __construct($realm, $scope = null, $error_uri = null)
{
parent::__construct($realm, $this->error, $this->error_description, $error_uri, $scope);
return $this;
}
/**
*
* @param string $realm
* @param string $scope
* @param string $error_uri
* @return API_OAuth2_Exception_WWWAuthenticate_InsufficientScope
*/
public function __construct($realm, $scope = null, $error_uri = null)
{
parent::__construct($realm, $this->error, $this->error_description, $error_uri, $scope);
return $this;
}
}

View File

@@ -22,31 +22,29 @@
*/
class API_OAuth2_Exception_WWWAuthenticate_InvalidClient extends API_OAuth2_Exception_WWWAuthenticate_Type_BadRequest
{
/**
*
* @var string
*/
protected $error = 'invalid_request';
/**
*
* @var string
*/
protected $error = 'invalid_request';
/**
*
* @var string
*/
protected $error_description = "The request is missing a required parameter, includes an unsupported parameter or parameter value, repeats the same parameter, uses more than one method for including an access token, or is otherwise malformed.";
/**
*
* @var string
*/
protected $error_description = "The request is missing a required parameter, includes an unsupported parameter or parameter value, repeats the same parameter, uses more than one method for including an access token, or is otherwise malformed.";
/**
*
* @param string $realm
* @param string $scope
* @param string $error_uri
* @return API_OAuth2_Exception_WWWAuthenticate_InvalidClient
*/
public function __construct($realm, $scope = null, $error_uri = null)
{
parent::__construct($realm, $this->error, $this->error_description, $error_uri, $scope);
return $this;
}
/**
*
* @param string $realm
* @param string $scope
* @param string $error_uri
* @return API_OAuth2_Exception_WWWAuthenticate_InvalidClient
*/
public function __construct($realm, $scope = null, $error_uri = null)
{
parent::__construct($realm, $this->error, $this->error_description, $error_uri, $scope);
return $this;
}
}

View File

@@ -22,31 +22,29 @@
*/
class API_OAuth2_Exception_WWWAuthenticate_InvalidRequest extends API_OAuth2_Exception_WWWAuthenticate_Type_BadRequest
{
/**
*
* @var string
*/
protected $error = 'invalid_request';
/**
*
* @var string
*/
protected $error = 'invalid_request';
/**
*
* @var string
*/
protected $error_description = "The request is missing a required parameter, includes an unsupported parameter or parameter value, repeats the same parameter, uses more than one method for including an access token, or is otherwise malformed.";
/**
*
* @var string
*/
protected $error_description = "The request is missing a required parameter, includes an unsupported parameter or parameter value, repeats the same parameter, uses more than one method for including an access token, or is otherwise malformed.";
/**
*
* @param string $realm
* @param string $scope
* @param string $error_uri
* @return API_OAuth2_Exception_WWWAuthenticate_InvalidRequest
*/
public function __construct($realm, $scope = null, $error_uri = null)
{
parent::__construct($realm, $this->error, $this->error_description, $error_uri, $scope);
return $this;
}
/**
*
* @param string $realm
* @param string $scope
* @param string $error_uri
* @return API_OAuth2_Exception_WWWAuthenticate_InvalidRequest
*/
public function __construct($realm, $scope = null, $error_uri = null)
{
parent::__construct($realm, $this->error, $this->error_description, $error_uri, $scope);
return $this;
}
}

View File

@@ -22,31 +22,29 @@
*/
class API_OAuth2_Exception_WWWAuthenticate_InvalidToken extends API_OAuth2_Exception_WWWAuthenticate_Type_Unauthorized
{
/**
*
* @var string
*/
protected $error = 'invalid_token';
/**
*
* @var string
*/
protected $error = 'invalid_token';
/**
*
* @var string
*/
protected $error_description = "The access token provided is invalid.";
/**
*
* @var string
*/
protected $error_description = "The access token provided is invalid.";
/**
*
* @param string $realm
* @param string $scope
* @param string $error_uri
* @return API_OAuth2_Exception_WWWAuthenticate_InvalidToken
*/
public function __construct($realm, $scope = null, $error_uri = null)
{
parent::__construct($realm, $this->error, $this->error_description, $error_uri, $scope);
return $this;
}
/**
*
* @param string $realm
* @param string $scope
* @param string $error_uri
* @return API_OAuth2_Exception_WWWAuthenticate_InvalidToken
*/
public function __construct($realm, $scope = null, $error_uri = null)
{
parent::__construct($realm, $this->error, $this->error_description, $error_uri, $scope);
return $this;
}
}

View File

@@ -22,27 +22,25 @@
*/
class API_OAuth2_Exception_WWWAuthenticate_Type_BadRequest extends API_OAuth2_Exception_WWWAuthenticate
{
/**
*
* @var int
*/
protected $http_code = 400;
/**
*
* @var int
*/
protected $http_code = 400;
/**
*
* @param string $realm
* @param string $error
* @param string $error_description
* @param string $error_uri
* @param string $scope
* @return API_OAuth2_Exception_WWWAuthenticate_Type_BadRequest
*/
public function __construct($realm, $error, $error_description = null, $error_uri = null, $scope = null)
{
parent::__construct($this->http_code, $realm, $error, $error_description = null, $error_uri, $scope);
return $this;
}
/**
*
* @param string $realm
* @param string $error
* @param string $error_description
* @param string $error_uri
* @param string $scope
* @return API_OAuth2_Exception_WWWAuthenticate_Type_BadRequest
*/
public function __construct($realm, $error, $error_description = null, $error_uri = null, $scope = null)
{
parent::__construct($this->http_code, $realm, $error, $error_description = null, $error_uri, $scope);
return $this;
}
}

View File

@@ -23,21 +23,20 @@
class API_OAuth2_Exception_WWWAuthenticate_Type_Forbidden extends API_OAuth2_Exception_WWWAuthenticate
{
/**
*
* @param string $realm
* @param string $error
* @param string $error_description
* @param string $error_uri
* @param string $scope
* @return API_OAuth2_Exception_WWWAuthenticate_Type_Forbidden
*/
public function __construct($realm, $error, $error_description = null, $error_uri = null, $scope = null)
{
parent::__construct($realm, $error, $error_description = null, $error_uri, $scope);
$this->setHttp_code(403);
return $this;
}
/**
*
* @param string $realm
* @param string $error
* @param string $error_description
* @param string $error_uri
* @param string $scope
* @return API_OAuth2_Exception_WWWAuthenticate_Type_Forbidden
*/
public function __construct($realm, $error, $error_description = null, $error_uri = null, $scope = null)
{
parent::__construct($realm, $error, $error_description = null, $error_uri, $scope);
$this->setHttp_code(403);
return $this;
}
}

View File

@@ -22,27 +22,25 @@
*/
class API_OAuth2_Exception_WWWAuthenticate_Type_Unauthorized extends API_OAuth2_Exception_WWWAuthenticate
{
/**
*
* @var string
*/
protected $http_code = 401;
/**
*
* @var string
*/
protected $http_code = 401;
/**
*
* @param string $realm
* @param string $error
* @param string $error_description
* @param string $error_uri
* @param string $scope
* @return API_OAuth2_Exception_WWWAuthenticate_Type_Unauthorized
*/
public function __construct($realm, $error, $error_description = null, $error_uri = null, $scope = null)
{
parent::__construct($this->http_code, $realm, $error, $error_description = null, $error_uri, $scope);
return $this;
}
/**
*
* @param string $realm
* @param string $error
* @param string $error_description
* @param string $error_uri
* @param string $scope
* @return API_OAuth2_Exception_WWWAuthenticate_Type_Unauthorized
*/
public function __construct($realm, $error, $error_description = null, $error_uri = null, $scope = null)
{
parent::__construct($this->http_code, $realm, $error, $error_description = null, $error_uri, $scope);
return $this;
}
}