Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update error text for consistency #528

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/JWT.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
// token can actually be used. If it's not yet that time, abort.
if (isset($payload->nbf) && floor($payload->nbf) > ($timestamp + static::$leeway)) {
$ex = new BeforeValidException(
'Cannot handle token with nbf prior to ' . \date(DateTime::ISO8601, (int) $payload->nbf)
'Cannot handle token with nbf prior to ' . \date(DateTime::ISO8601, floor($payload->nbf))

Check failure on line 157 in src/JWT.php

View workflow job for this annotation

GitHub Actions / PHPStan Static Analysis

Parameter #2 $timestamp of function date expects int|null, float given.
);
$ex->setPayload($payload);
throw $ex;
Expand All @@ -165,7 +165,7 @@
// correctly used the nbf claim).
if (!isset($payload->nbf) && isset($payload->iat) && floor($payload->iat) > ($timestamp + static::$leeway)) {
$ex = new BeforeValidException(
'Cannot handle token with iat prior to ' . \date(DateTime::ISO8601, (int) $payload->iat)
'Cannot handle token with iat prior to ' . \date(DateTime::ISO8601, floor($payload->iat))

Check failure on line 168 in src/JWT.php

View workflow job for this annotation

GitHub Actions / PHPStan Static Analysis

Parameter #2 $timestamp of function date expects int|null, float given.
);
$ex->setPayload($payload);
throw $ex;
Expand Down