However, projects running Laravel 11 and also requiring carbon:^3 (or have other dependencies requiring it), cannot install jwt-auth because we still only support carbon^2.
Add support for carbon^3
Carbon 3 has some breaking changes and one of them affected the Method diffInRealMinutes we call from \PHPOpenSourceSaver\JWTAuth\Blacklist::getMinutesUntilExpired
the result was negative, i.e. -2…
the result was a float, i.e. had a decimal point: .9…
The change using round() and adding a 2nd arg true keeps the code BC.
Without the fix, tests in \PHPOpenSourceSaver\JWTAuth\Test\BlacklistTest would fail
Summary
Laravel 11 support was recently added via https://github.com/PHP-Open-Source-Saver/jwt-auth/pull/233
Laravel 11 supports both carbon 2 & 3, see https://github.com/laravel/framework/blob/ae2f9413b5bd8637c363e6fafffda31c88e56c9e/composer.json#L39
However, projects running Laravel 11 and also requiring carbon:^3 (or have other dependencies requiring it), cannot install jwt-auth because we still only support carbon^2.
This PR fixes that, see also https://github.com/PHP-Open-Source-Saver/jwt-auth/issues/230#issuecomment-2002016625
Overview of changes
prefer-lowest
did install carbon^2, see any random run, e.g. https://github.com/PHP-Open-Source-Saver/jwt-auth/actions/runs/8252381702/job/22571741990#step:11:34Add support for carbon^3 Carbon 3 has some breaking changes and one of them affected the Method
diffInRealMinutes
we call from\PHPOpenSourceSaver\JWTAuth\Blacklist::getMinutesUntilExpired
-2…
.9…
The change using
round()
and adding a 2nd argtrue
keeps the code BC. Without the fix, tests in\PHPOpenSourceSaver\JWTAuth\Test\BlacklistTest
would fail