From 0b6bcad9fbbdc1158d0f4e20366cf322ab4917fa Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Fri, 12 Feb 2016 09:59:59 +0000 Subject: [PATCH] Added getCookieParameter method --- src/Grant/AbstractGrant.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Grant/AbstractGrant.php b/src/Grant/AbstractGrant.php index 656affd0..5be39338 100644 --- a/src/Grant/AbstractGrant.php +++ b/src/Grant/AbstractGrant.php @@ -264,6 +264,20 @@ abstract class AbstractGrant implements GrantTypeInterface return (isset($request->getQueryParams()[$parameter])) ? $request->getQueryParams()[$parameter] : $default; } + /** + * Retrieve cookie parameter. + * + * @param string $parameter + * @param \Psr\Http\Message\ServerRequestInterface $request + * @param mixed $default + * + * @return null|string + */ + protected function getCookieParameter($parameter, ServerRequestInterface $request, $default = null) + { + return (isset($request->getCookieParams()[$parameter])) ? $request->getCookieParams()[$parameter] : $default; + } + /** * Retrieve server parameter. *