Skip to content

Commit

Permalink
move interval argument to the end
Browse files Browse the repository at this point in the history
  • Loading branch information
hafezdivandari committed Nov 14, 2024
1 parent 0dc1657 commit 05821f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Exception/OAuthServerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ' .
Expand Down Expand Up @@ -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 ' .
Expand Down
4 changes: 2 additions & 2 deletions src/Grant/DeviceCodeGrant.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}

Expand Down

0 comments on commit 05821f9

Please sign in to comment.