diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 67e80afa..11cce189 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -21,7 +21,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.3 coverage: none - name: Determine composer cache directory diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 760ea990..60cd1c26 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -31,7 +31,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.3 coverage: none - name: Get composer cache directory diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 6d0a4072..88ff0504 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -15,78 +15,20 @@ jobs: strategy: fail-fast: false matrix: - php: [7.4, 8.0, 8.1, 8.2, 8.3] - laravel: [6.*, 7.*, 8.*, 9.*, 10.*, 11.*] + php: [8.1, 8.2, 8.3] + laravel: [10.*, 11.*] stability: [prefer-lowest, prefer-stable] os: [ubuntu-latest] coverage: [none] exclude: - - laravel: 6.* - 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.* - php: 8.0 - - laravel: 11.* - php: 7.4 - - laravel: 11.* - php: 8.0 - laravel: 11.* php: 8.1 include: - - laravel: 6.* - dotenv: ^3.3 - - - laravel: 7.* - dotenv: ^4.0 - - - laravel: 8.* - dotenv: ^5.2 - - - laravel: 9.* - dotenv: ^5.2 - - - laravel: 10.* - dotenv: ^5.4.1 - - - laravel: 11.* - dotenv: ^5.4.1 - - - php: 8.0 - laravel: 9.* - stability: prefer-stable - os: ubuntu-latest - coverage: xdebug - dotenv: ^5.2 - - php: 8.1 laravel: 10.* stability: prefer-stable os: ubuntu-latest coverage: xdebug - dotenv: ^5.4.1 name: '[PHP ${{ matrix.php }}] [Laravel ${{ matrix.laravel }} - ${{ matrix.stability }}] [${{ matrix.coverage }} coverage]' @@ -122,7 +64,6 @@ jobs: - name: Set Minimum Laravel ${{ matrix.laravel }} Versions run: | composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-progress --no-update - composer require "vlucas/phpdotenv:${{ matrix.dotenv }}" --no-interaction --no-progress --no-update --dev - name: Cache dependencies uses: actions/cache@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 00a5001e..8d2de10e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,14 @@ You can find and compare releases at the GitHub release page. ## [Unreleased] +### Added +- Support for Carbon 3 (and drop Carbon 1, but it was unused anyway) + +### Removed +- Dropped support for Laravel < 10 and PHP < 8.1 + +## [2.2.0] 2024-03-12 + ### Added - Different TTL configurations for each guard - lcobucci/jwt: add array support for `aud` claim diff --git a/README.md b/README.md index b674c6dd..9c59aca7 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This uses different namespace, then `tymondesigns/jwt-auth`, but overall, provid ### Notes -Due to new features, added in our library, there are some incompatibilities. _This won't hurt you in most cases_, unless you have [implicitly disabled autodiscovery](https://laravel.com/docs/8.x/packages#opting-out-of-package-discovery) for original Tymon's package. +Due to new features, added in our library, there are some incompatibilities. _This won't hurt you in most cases_, unless you have [implicitly disabled autodiscovery](https://laravel.com/docs/11.x/packages#opting-out-of-package-discovery) for original Tymon's package. Current compatability breaks: - [`JWTGuard`](src/JWTGuard.php) have new required constructor parameter [`$eventDispatcher`](src/Providers/AbstractServiceProvider.php#L97) diff --git a/composer.json b/composer.json index 3b24fb7e..48fcba46 100644 --- a/composer.json +++ b/composer.json @@ -33,26 +33,24 @@ } ], "require": { - "php": "^7.4|^8.0", + "php": "^8.1", "ext-json": "*", - "illuminate/auth": "^6|^7|^8.67|^9|^10|^11", - "illuminate/contracts": "^6|^7|^8.67|^9|^10|^11", - "illuminate/http": "^6|^7|^8.67|^9|^10|^11", - "illuminate/support": "^6|^7|^8.67|^9|^10|^11", + "illuminate/auth": "^10|^11", + "illuminate/contracts": "^10|^11", + "illuminate/http": "^10|^11", + "illuminate/support": "^10|^11", "lcobucci/jwt": "^4.0", "namshi/jose": "^7.0", "nesbot/carbon": "^2.0|^3.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3", - "illuminate/console": "^6|^7|^8.67|^9|^10|^11", - "illuminate/routing": "^6|^7|^8.67|^9|^10|^11", - "orchestra/testbench": "^4.18|^5.8|^6.3|^7|^8|^9|9.x-dev", + "illuminate/console": "^10|^11", + "illuminate/routing": "^10|^11", + "orchestra/testbench": "^8|^9", "mockery/mockery": "^1.4.4", "phpstan/phpstan": "^1", - "phpunit/phpunit": "^8.5|^9.4|^10", - "vlucas/phpdotenv": "^5.2.0", - "yoast/phpunit-polyfills": "^2.0.0" + "phpunit/phpunit": "^9.4|^10" }, "autoload": { "psr-4": { diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 252d77f5..ea4e0664 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -70,6 +70,11 @@ parameters: count: 1 path: tests/Stubs/LaravelUserStub.php + - + message: "#^Method PHPOpenSourceSaver\\\\JWTAuth\\\\Test\\\\Stubs\\\\LaravelUserStub\\:\\:getAuthPasswordName\\(\\) should return string but return statement is missing\\.$#" + count: 1 + path: tests/Stubs/LaravelUserStub.php + - message: "#^Method PHPOpenSourceSaver\\\\JWTAuth\\\\Test\\\\Stubs\\\\LaravelUserStub\\:\\:getRememberToken\\(\\) should return string but return statement is missing\\.$#" count: 1 diff --git a/tests/AbstractTestCase.php b/tests/AbstractTestCase.php index fc34785b..948b0da6 100644 --- a/tests/AbstractTestCase.php +++ b/tests/AbstractTestCase.php @@ -13,7 +13,7 @@ namespace PHPOpenSourceSaver\JWTAuth\Test; use Carbon\Carbon; -use Yoast\PHPUnitPolyfills\TestCases\TestCase; +use PHPUnit\Framework\TestCase; abstract class AbstractTestCase extends TestCase {