mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-01 16:33:07 +05:30
Syntax improvements
This commit is contained in:
parent
92404ab2bf
commit
b8331d12e4
@ -102,7 +102,7 @@ class AuthorizationServer extends AbstractServer
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a grant type has been enabled
|
* Check if a grant type has been enabled
|
||||||
* @param string $identifier The grant type identifier
|
* @param string $identifier The grant type identifier
|
||||||
* @return boolean Returns "true" if enabled, "false" if not
|
* @return boolean Returns "true" if enabled, "false" if not
|
||||||
*/
|
*/
|
||||||
public function hasGrantType($identifier)
|
public function hasGrantType($identifier)
|
||||||
@ -247,7 +247,7 @@ class AuthorizationServer extends AbstractServer
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a grant type class
|
* Return a grant type class
|
||||||
* @param string $grantType The grant type identifier
|
* @param string $grantType The grant type identifier
|
||||||
* @return Grant\GrantTypeInterface
|
* @return Grant\GrantTypeInterface
|
||||||
* @throws
|
* @throws
|
||||||
*/
|
*/
|
||||||
|
@ -92,7 +92,7 @@ abstract class AbstractGrant implements GrantTypeInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Override the default access token expire time
|
* Override the default access token expire time
|
||||||
* @param int $accessTokenTTL
|
* @param int $accessTokenTTL
|
||||||
* @return self
|
* @return self
|
||||||
*/
|
*/
|
||||||
public function setAccessTokenTTL($accessTokenTTL)
|
public function setAccessTokenTTL($accessTokenTTL)
|
||||||
@ -114,9 +114,9 @@ abstract class AbstractGrant implements GrantTypeInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Given a list of scopes, validate them and return an array of Scope entities
|
* Given a list of scopes, validate them and return an array of Scope entities
|
||||||
* @param string $scopeParam A string of scopes (e.g. "profile email birthday")
|
* @param string $scopeParam A string of scopes (e.g. "profile email birthday")
|
||||||
* @param \League\OAuth2\Server\Entity\ClientEntity $client Client entity
|
* @param \League\OAuth2\Server\Entity\ClientEntity $client Client entity
|
||||||
* @param string|null $redirectUri The redirect URI to return the user to
|
* @param string|null $redirectUri The redirect URI to return the user to
|
||||||
* @return \League\OAuth2\Server\Entity\ScopeEntity[]
|
* @return \League\OAuth2\Server\Entity\ScopeEntity[]
|
||||||
* @throws \League\OAuth2\Server\Exception\InvalidScopeException If scope is invalid, or no scopes passed when required
|
* @throws \League\OAuth2\Server\Exception\InvalidScopeException If scope is invalid, or no scopes passed when required
|
||||||
* @throws
|
* @throws
|
||||||
|
@ -57,7 +57,7 @@ class AuthCodeGrant extends AbstractGrant
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Override the default access token expire time
|
* Override the default access token expire time
|
||||||
* @param int $authTokenTTL
|
* @param int $authTokenTTL
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setAuthTokenTTL($authTokenTTL)
|
public function setAuthTokenTTL($authTokenTTL)
|
||||||
@ -118,11 +118,11 @@ class AuthCodeGrant extends AbstractGrant
|
|||||||
$scopes = $this->validateScopes($scopeParam, $client, $redirectUri);
|
$scopes = $this->validateScopes($scopeParam, $client, $redirectUri);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'client' => $client,
|
'client' => $client,
|
||||||
'redirect_uri' => $redirectUri,
|
'redirect_uri' => $redirectUri,
|
||||||
'state' => $state,
|
'state' => $state,
|
||||||
'response_type' => $responseType,
|
'response_type' => $responseType,
|
||||||
'scopes' => $scopes
|
'scopes' => $scopes
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ class PasswordGrant extends AbstractGrant
|
|||||||
*/
|
*/
|
||||||
protected function getVerifyCredentialsCallback()
|
protected function getVerifyCredentialsCallback()
|
||||||
{
|
{
|
||||||
if (is_null($this->callback) || ! is_callable($this->callback)) {
|
if (is_null($this->callback) || !is_callable($this->callback)) {
|
||||||
throw new Exception\ServerErrorException('Null or non-callable callback set on Password grant');
|
throw new Exception\ServerErrorException('Null or non-callable callback set on Password grant');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ class RefreshTokenGrant extends AbstractGrant
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the TTL of the refresh token
|
* Set the TTL of the refresh token
|
||||||
* @param int $refreshTokenTTL
|
* @param int $refreshTokenTTL
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setRefreshTokenTTL($refreshTokenTTL)
|
public function setRefreshTokenTTL($refreshTokenTTL)
|
||||||
|
Loading…
Reference in New Issue
Block a user