diff --git a/src/Exception/OAuthServerException.php b/src/Exception/OAuthServerException.php index dfe45d59c..43d042647 100644 --- a/src/Exception/OAuthServerException.php +++ b/src/Exception/OAuthServerException.php @@ -215,7 +215,7 @@ public static function expiredToken(?string $hint = null, ?Throwable $previous = return new static($errorMessage, 11, 'expired_token', 400, $hint, null, $previous); } - public static function authorizationPending(?int $interval = null, string $hint = '', ?Throwable $previous = null): static + public static function authorizationPending(string $hint = '', ?Throwable $previous = null, ?int $interval = null): static { $exception = new static( 'The authorization request is still pending as the end user ' . @@ -245,7 +245,7 @@ public static function authorizationPending(?int $interval = null, string $hint * * @return static */ - public static function slowDown(?int $interval = null, string $hint = '', ?Throwable $previous = null): static + public static function slowDown(string $hint = '', ?Throwable $previous = null, ?int $interval = null): static { $exception = new static( 'The authorization request is still pending and polling should ' . diff --git a/src/Grant/DeviceCodeGrant.php b/src/Grant/DeviceCodeGrant.php index 12797fa9f..91bc8df5f 100644 --- a/src/Grant/DeviceCodeGrant.php +++ b/src/Grant/DeviceCodeGrant.php @@ -159,12 +159,12 @@ public function respondToAccessTokenRequest( if ($shouldSlowDown) { throw OAuthServerException::slowDown( - $this->intervalVisibility ? $deviceCodeEntity->getInterval() : null + interval: $this->intervalVisibility ? $deviceCodeEntity->getInterval() : null ); } throw OAuthServerException::authorizationPending( - $this->intervalVisibility ? $deviceCodeEntity->getInterval() : null + interval: $this->intervalVisibility ? $deviceCodeEntity->getInterval() : null ); }