Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for Laravel < 10 #238

Merged
merged 7 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
63 changes: 2 additions & 61 deletions .github/workflows/phpunit.yml
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is really a lot of stuff not necessary anymore!

Original file line number Diff line number Diff line change
Expand Up @@ -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]'

Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 9 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed 9.x-dev for testbench, was only necessary before the Laravel 11 release

"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"
Comment on lines -54 to -55
Copy link
Contributor Author

@mfn mfn Mar 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out these two dev deps were not needed anymore 🤷🏼

"phpunit/phpunit": "^9.4|^10"
},
"autoload": {
"psr-4": {
Expand Down
5 changes: 5 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +73 to +76
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpstan with latest PHP 8.3 produced this; as with all errors from Stubs, added it here (i.e. there are already others in the neon file here too).


-
message: "#^Method PHPOpenSourceSaver\\\\JWTAuth\\\\Test\\\\Stubs\\\\LaravelUserStub\\:\\:getRememberToken\\(\\) should return string but return statement is missing\\.$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion tests/AbstractTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Loading