From bfcf7af4d85e6cd7becdeafa341e5b59b4798897 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Fri, 12 Feb 2016 09:02:17 +0000 Subject: [PATCH] Added getQueryStringParameter method --- src/Grant/AbstractGrant.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Grant/AbstractGrant.php b/src/Grant/AbstractGrant.php index 42c1644e..bf526b8c 100644 --- a/src/Grant/AbstractGrant.php +++ b/src/Grant/AbstractGrant.php @@ -239,6 +239,20 @@ abstract class AbstractGrant implements GrantTypeInterface return (isset($request->getParsedBody()[$parameter])) ? $request->getParsedBody()[$parameter] : $default; } + /** + * Retrieve query string parameter. + * + * @param string $parameter + * @param \Psr\Http\Message\ServerRequestInterface $request + * @param mixed $default + * + * @return null|string + */ + protected function getQueryStringParameter($parameter, ServerRequestInterface $request, $default = null) + { + return (isset($request->getQueryParams()[$parameter])) ? $request->getQueryParams()[$parameter] : $default; + } + /** * Retrieve server parameter. *