From 86869eafbb442ed9423850ffdd1bf366c9d613e1 Mon Sep 17 00:00:00 2001 From: sephster Date: Sun, 5 May 2019 09:03:13 +0100 Subject: [PATCH] Add whitespace around control blocks --- src/Grant/AbstractGrant.php | 2 ++ src/Grant/AuthCodeGrant.php | 1 + src/Grant/PasswordGrant.php | 1 + src/Grant/RefreshTokenGrant.php | 1 + 4 files changed, 5 insertions(+) diff --git a/src/Grant/AbstractGrant.php b/src/Grant/AbstractGrant.php index 45269ac7..6d7ff18d 100644 --- a/src/Grant/AbstractGrant.php +++ b/src/Grant/AbstractGrant.php @@ -477,6 +477,7 @@ abstract class AbstractGrant implements GrantTypeInterface protected function issueRefreshToken(AccessTokenEntityInterface $accessToken) { $refreshToken = $this->refreshTokenRepository->getNewRefreshToken(); + if ($refreshToken === null) { return null; } @@ -485,6 +486,7 @@ abstract class AbstractGrant implements GrantTypeInterface $refreshToken->setAccessToken($accessToken); $maxGenerationAttempts = self::MAX_RANDOM_TOKEN_GENERATION_ATTEMPTS; + while ($maxGenerationAttempts-- > 0) { $refreshToken->setIdentifier($this->generateUniqueIdentifier()); try { diff --git a/src/Grant/AuthCodeGrant.php b/src/Grant/AuthCodeGrant.php index d7dd6b8f..350fdde5 100644 --- a/src/Grant/AuthCodeGrant.php +++ b/src/Grant/AuthCodeGrant.php @@ -152,6 +152,7 @@ class AuthCodeGrant extends AbstractAuthorizeGrant // Issue and persist new refresh token if given $refreshToken = $this->issueRefreshToken($accessToken); + if ($refreshToken !== null) { $this->getEmitter()->emit(new RequestEvent(RequestEvent::REFRESH_TOKEN_ISSUED, $request)); $responseType->setRefreshToken($refreshToken); diff --git a/src/Grant/PasswordGrant.php b/src/Grant/PasswordGrant.php index 124bb4f8..cb53ccd8 100644 --- a/src/Grant/PasswordGrant.php +++ b/src/Grant/PasswordGrant.php @@ -63,6 +63,7 @@ class PasswordGrant extends AbstractGrant // Issue and persist new refresh token if given $refreshToken = $this->issueRefreshToken($accessToken); + if ($refreshToken !== null) { $this->getEmitter()->emit(new RequestEvent(RequestEvent::REFRESH_TOKEN_ISSUED, $request)); $responseType->setRefreshToken($refreshToken); diff --git a/src/Grant/RefreshTokenGrant.php b/src/Grant/RefreshTokenGrant.php index 24932441..d0794075 100644 --- a/src/Grant/RefreshTokenGrant.php +++ b/src/Grant/RefreshTokenGrant.php @@ -70,6 +70,7 @@ class RefreshTokenGrant extends AbstractGrant // Issue and persist new refresh token if given $refreshToken = $this->issueRefreshToken($accessToken); + if ($refreshToken !== null) { $this->getEmitter()->emit(new RequestEvent(RequestEvent::REFRESH_TOKEN_ISSUED, $request)); $responseType->setRefreshToken($refreshToken);