Skip to content

Commit cd55a88

Browse files
Merge pull request #286 from jonkerw85/main
Fixed the return type of getMinutesUntilExpired in BlackList, which returned a float instead of an int when using Carbon v2.
2 parents 54116ef + 6f0eeb0 commit cd55a88

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
You can find and compare releases at the [GitHub release page](https://github.com/PHP-Open-Source-Saver/jwt-auth/releases).
88

99
## [Unreleased]
10+
### Fixed
11+
- Fixed the return type of getMinutesUntilExpired in BlackList, which returned a float instead of an int when using Carbon v2.
1012

1113
## [2.8.0] 2025-02-11
1214
Please see (https://github.com/PHP-Open-Source-Saver/jwt-auth/releases/tag/2.8.0)

src/Blacklist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected function getMinutesUntilExpired(Payload $payload)
9999

100100
// Handle Carbon 2 vs 3 deprecation of "Real" diff functions, see https://github.com/PHP-Open-Source-Saver/jwt-auth/issues/260
101101
if (method_exists($intermediateResult, 'diffInRealMinutes')) {
102-
return round($intermediateResult->diffInRealMinutes(null, true));
102+
return (int) round($intermediateResult->diffInRealMinutes(null, true));
103103
} else {
104104
return (int) round($intermediateResult->diffInMinutes(null, true));
105105
}

0 commit comments

Comments
 (0)