From 086c6d6d277f4d4e7541f839f5f61c5b1a345224 Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Mon, 18 Mar 2024 13:41:52 +0100 Subject: [PATCH 1/7] Drop support for Laravel < 10 This also means we drop PHP < 8.1, as 8.1 is the minimum. Also take the opportunity to bump other PHP versions to their latest stable release (8.3) for GHA workflows. Also removed the explicit dotenv references, don't seem to be necessary. --- .github/workflows/php-cs-fixer.yml | 2 +- .github/workflows/phpstan.yml | 2 +- .github/workflows/phpunit.yml | 63 +----------------------------- composer.json | 18 ++++----- 4 files changed, 13 insertions(+), 72 deletions(-) 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/composer.json b/composer.json index 3b24fb7e..5d5d5849 100644 --- a/composer.json +++ b/composer.json @@ -33,24 +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", + "phpunit/phpunit": "^9.4|^10", "vlucas/phpdotenv": "^5.2.0", "yoast/phpunit-polyfills": "^2.0.0" }, From 080fd7a4f8293eae4a151d89c33f8980c1011dac Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Mon, 18 Mar 2024 13:45:33 +0100 Subject: [PATCH 2/7] composer phpstan-baseline --- phpstan-baseline.neon | 5 +++++ 1 file changed, 5 insertions(+) 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 From dca627ffc804042c8dd5794cd2980ca38dc592b1 Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Mon, 18 Mar 2024 13:47:13 +0100 Subject: [PATCH 3/7] Remove explicit dev dependency on phpdotenv --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 5d5d5849..52dfcecb 100644 --- a/composer.json +++ b/composer.json @@ -51,7 +51,6 @@ "mockery/mockery": "^1.4.4", "phpstan/phpstan": "^1", "phpunit/phpunit": "^9.4|^10", - "vlucas/phpdotenv": "^5.2.0", "yoast/phpunit-polyfills": "^2.0.0" }, "autoload": { From ee1b6ad39de6333c6e3bdfeac707e7f302fcd9e4 Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Mon, 18 Mar 2024 13:49:22 +0100 Subject: [PATCH 4/7] Remove yoast/phpunit-polyfills Not needed anymore --- composer.json | 3 +-- tests/AbstractTestCase.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 52dfcecb..48fcba46 100644 --- a/composer.json +++ b/composer.json @@ -50,8 +50,7 @@ "orchestra/testbench": "^8|^9", "mockery/mockery": "^1.4.4", "phpstan/phpstan": "^1", - "phpunit/phpunit": "^9.4|^10", - "yoast/phpunit-polyfills": "^2.0.0" + "phpunit/phpunit": "^9.4|^10" }, "autoload": { "psr-4": { 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 { From 6908160acdba76eb32d262ec5492f0469e73f346 Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Mon, 18 Mar 2024 13:55:23 +0100 Subject: [PATCH 5/7] Update changelog from master --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00a5001e..2fa9a7a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ 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) + +## [2.2.0] 2024-03-12 + ### Added - Different TTL configurations for each guard - lcobucci/jwt: add array support for `aud` claim From 0abe37bbc687c72d4fa674d6600ec97ff4bde97a Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Mon, 18 Mar 2024 13:55:42 +0100 Subject: [PATCH 6/7] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fa9a7a7..8d2de10e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ You can find and compare releases at the GitHub release page. ### 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 From a81224f37976cc4eb8b1cd0edafb91b0f2c4c79e Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Mon, 18 Mar 2024 13:57:01 +0100 Subject: [PATCH 7/7] Fix link to point to more recent version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)