From 2df55f8c6c9ed37f7ba916b70d86011bc07b64b9 Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Sun, 17 Mar 2024 13:42:46 +0100 Subject: [PATCH 1/3] gha: test against PHP 8.3 --- .github/workflows/phpunit.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index a3718e8d..baff5697 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - php: [7.4, 8.0, 8.1, 8.2] + php: [7.4, 8.0, 8.1, 8.2, 8.3] laravel: [6.*, 7.*, 8.*, 9.*, 10.*, 11.*] stability: [prefer-lowest, prefer-stable] os: [ubuntu-latest] @@ -25,18 +25,26 @@ jobs: php: 8.1 - laravel: 6.* php: 8.2 + - laravel: 6.* + php: 8.3 - laravel: 7.* php: 8.1 - laravel: 7.* php: 8.2 + - laravel: 7.* + php: 8.3 - laravel: 8.* php: 8.2 stability: prefer-lowest + - laravel: 8.* + php: 8.3 - laravel: 9.* php: 7.4 - laravel: 9.* php: 8.2 stability: prefer-lowest + - laravel: 9.* + php: 8.3 - laravel: 10.* php: 7.4 - laravel: 10.* From 3f0fda22a9d982e66d170d5345a8041d8276a522 Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Sun, 17 Mar 2024 14:20:49 +0100 Subject: [PATCH 2/3] Remove carbon:^1 There is no combination with Laravel which supports Carbon 1 anymore. Even Laravel 6 requires carbon:^2 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e970f1fe..ca0dc110 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "illuminate/support": "^6|^7|^8.67|^9|^10|^11", "lcobucci/jwt": "^4.0", "namshi/jose": "^7.0", - "nesbot/carbon": "^1.0|^2.0" + "nesbot/carbon": "^2.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3", From ae0479337749ef1ca60b3de25e70a7b90b2a1bc9 Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Sun, 17 Mar 2024 14:22:48 +0100 Subject: [PATCH 3/3] Allow carbon ^3 Adjust getMinutesUntilExpired() to be compatible with existing behavior. Before carbon^3, the result was a rounded integer. With carbon^3, the result was: - negative (-2....) - a decimal (.9....) Rounding and adding the second `true` parameter keeps in BC. --- composer.json | 2 +- src/Blacklist.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index ca0dc110..3e07720b 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "illuminate/support": "^6|^7|^8.67|^9|^10|^11", "lcobucci/jwt": "^4.0", "namshi/jose": "^7.0", - "nesbot/carbon": "^2.0" + "nesbot/carbon": "^2.0|^3.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3", diff --git a/src/Blacklist.php b/src/Blacklist.php index 07e79ef9..746c96d8 100644 --- a/src/Blacklist.php +++ b/src/Blacklist.php @@ -95,7 +95,7 @@ protected function getMinutesUntilExpired(Payload $payload) // get the latter of the two expiration dates and find // the number of minutes until the expiration date, // plus 1 minute to avoid overlap - return $exp->max($iat->addMinutes($this->refreshTTL))->addMinute()->diffInRealMinutes(); + return round($exp->max($iat->addMinutes($this->refreshTTL))->addMinute()->diffInRealMinutes(null, true)); } /**