diff --git a/src/Exception/OAuthServerException.php b/src/Exception/OAuthServerException.php index f313967ad..9eff92456 100644 --- a/src/Exception/OAuthServerException.php +++ b/src/Exception/OAuthServerException.php @@ -20,8 +20,6 @@ use function htmlspecialchars; use function http_build_query; use function sprintf; -use function strpos; -use function strstr; class OAuthServerException extends Exception { diff --git a/src/Grant/AbstractGrant.php b/src/Grant/AbstractGrant.php index 31252cc1e..5e327de3c 100644 --- a/src/Grant/AbstractGrant.php +++ b/src/Grant/AbstractGrant.php @@ -197,6 +197,7 @@ protected function getClientEntityOrFail(string $clientId, ServerRequestInterfac * the Http Basic Authorization header * * @return array{0:non-empty-string,1:string} + * * @throws OAuthServerException */ protected function getClientCredentials(ServerRequestInterface $request): array @@ -281,6 +282,7 @@ private function convertScopesQueryStringToArray(string $scopes): array * @param array $request * * @return non-empty-string|null + * * @throws OAuthServerException */ private static function parseParam(string $parameter, array $request, ?string $default = null): ?string @@ -288,7 +290,7 @@ private static function parseParam(string $parameter, array $request, ?string $d $value = $request[$parameter] ?? ''; if (is_scalar($value)) { - $value = trim((string)$value); + $value = trim((string) $value); } else { throw OAuthServerException::invalidRequest($parameter); } @@ -308,6 +310,7 @@ private static function parseParam(string $parameter, array $request, ?string $d * Retrieve request parameter. * * @return non-empty-string|null + * * @throws OAuthServerException */ protected function getRequestParameter(string $parameter, ServerRequestInterface $request, ?string $default = null): ?string @@ -358,6 +361,7 @@ protected function getBasicAuthCredentials(ServerRequestInterface $request): arr * Retrieve query string parameter. * * @return non-empty-string|null + * * @throws OAuthServerException */ protected function getQueryStringParameter(string $parameter, ServerRequestInterface $request, ?string $default = null): ?string @@ -369,6 +373,7 @@ protected function getQueryStringParameter(string $parameter, ServerRequestInter * Retrieve cookie parameter. * * @return non-empty-string|null + * * @throws OAuthServerException */ protected function getCookieParameter(string $parameter, ServerRequestInterface $request, ?string $default = null): ?string @@ -380,6 +385,7 @@ protected function getCookieParameter(string $parameter, ServerRequestInterface * Retrieve server parameter. * * @return non-empty-string|null + * * @throws OAuthServerException */ protected function getServerParameter(string $parameter, ServerRequestInterface $request, ?string $default = null): ?string