From 825017f27ecd20f101bcf864769222e24a92f886 Mon Sep 17 00:00:00 2001 From: Luca Santarella Date: Wed, 25 Oct 2017 18:30:17 -0400 Subject: [PATCH 1/3] Ability to specify query delimiter, such as `?` instead of the hard-coded `#` --- src/Grant/ImplicitGrant.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Grant/ImplicitGrant.php b/src/Grant/ImplicitGrant.php index 2f7ea51f..4ed2de63 100644 --- a/src/Grant/ImplicitGrant.php +++ b/src/Grant/ImplicitGrant.php @@ -27,11 +27,18 @@ class ImplicitGrant extends AbstractAuthorizeGrant private $accessTokenTTL; /** - * @param \DateInterval $accessTokenTTL + * @var string */ - public function __construct(\DateInterval $accessTokenTTL) + private $queryDelimiter; + + /** + * @param \DateInterval $accessTokenTTL + * @param string $queryDelimiter + */ + public function __construct(\DateInterval $accessTokenTTL, $queryDelimiter = '#') { $this->accessTokenTTL = $accessTokenTTL; + $this->queryDelimiter = $queryDelimiter; } /** @@ -204,7 +211,7 @@ class ImplicitGrant extends AbstractAuthorizeGrant 'expires_in' => $accessToken->getExpiryDateTime()->getTimestamp() - (new \DateTime())->getTimestamp(), 'state' => $authorizationRequest->getState(), ], - '#' + $this->queryDelimiter ) ); From 606f69e6cd8f1746f2ef5c9d539b303d569d27ef Mon Sep 17 00:00:00 2001 From: Luca Santarella Date: Wed, 25 Oct 2017 18:33:26 -0400 Subject: [PATCH 2/3] Fixed indentation in comment to match code style --- src/Grant/ImplicitGrant.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Grant/ImplicitGrant.php b/src/Grant/ImplicitGrant.php index 4ed2de63..ed2f4b5d 100644 --- a/src/Grant/ImplicitGrant.php +++ b/src/Grant/ImplicitGrant.php @@ -32,9 +32,9 @@ class ImplicitGrant extends AbstractAuthorizeGrant private $queryDelimiter; /** - * @param \DateInterval $accessTokenTTL - * @param string $queryDelimiter - */ + * @param \DateInterval $accessTokenTTL + * @param string $queryDelimiter + */ public function __construct(\DateInterval $accessTokenTTL, $queryDelimiter = '#') { $this->accessTokenTTL = $accessTokenTTL; From a4fc05c31e8463ca984743749de2366131b9ae5b Mon Sep 17 00:00:00 2001 From: Luca Santarella Date: Wed, 25 Oct 2017 18:33:26 -0400 Subject: [PATCH 3/3] Fixed indentation in comment to match code style --- src/Grant/ImplicitGrant.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Grant/ImplicitGrant.php b/src/Grant/ImplicitGrant.php index 4ed2de63..4a16314f 100644 --- a/src/Grant/ImplicitGrant.php +++ b/src/Grant/ImplicitGrant.php @@ -31,10 +31,10 @@ class ImplicitGrant extends AbstractAuthorizeGrant */ private $queryDelimiter; - /** - * @param \DateInterval $accessTokenTTL - * @param string $queryDelimiter - */ + /** + * @param \DateInterval $accessTokenTTL + * @param string $queryDelimiter + */ public function __construct(\DateInterval $accessTokenTTL, $queryDelimiter = '#') { $this->accessTokenTTL = $accessTokenTTL;