Skip to content

Commit

Permalink
[12.x] Supports PHP 8.4 (#1799)
Browse files Browse the repository at this point in the history
* [12.x] Supports PHP 8.4

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* Update tests.yml

* wip

Signed-off-by: Mior Muhammad Zaki <[email protected]>

* Update tests.yml

---------

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone authored Jan 13, 2025
1 parent e94b531 commit b06a413
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
24 changes: 13 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ['8.0', 8.1, 8.2, 8.3]
laravel: [9, 10, 11]
exclude:
- php: '8.0'
laravel: 10
php: [8.1, 8.2, 8.3, 8.4]
laravel: [10, 11]
include:
- php: 8.2
laravel: 9
- php: 8.1
laravel: 9
- php: '8.0'
laravel: 11
laravel: 9
exclude:
- php: 8.1
laravel: 11
- php: 8.3
laravel: 9
- php: 8.4
laravel: 10

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}

Expand All @@ -45,8 +48,7 @@ jobs:

- name: Install dependencies
run: |
composer require "illuminate/contracts=^${{ matrix.laravel }}" --no-update
composer update --prefer-dist --no-interaction --no-progress
composer update --prefer-dist --no-interaction --no-progress --with="illuminate/contracts=^${{ matrix.laravel }}"
- name: Execute tests
run: vendor/bin/phpunit
run: vendor/bin/phpunit ${{ matrix.laravel >= 10 && '--display-deprecations' || '' }}
2 changes: 2 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
php:
preset: laravel
enabled:
- nullable_type_declarations
js: true
css: true
6 changes: 3 additions & 3 deletions src/Passport.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public static function tokensCan(array $scopes)
* @param \DateTimeInterface|\DateInterval|null $date
* @return \DateInterval|static
*/
public static function tokensExpireIn(DateTimeInterface|DateInterval $date = null)
public static function tokensExpireIn(DateTimeInterface|DateInterval|null $date = null)
{
if (is_null($date)) {
return static::$tokensExpireIn ?? new DateInterval('P1Y');
Expand All @@ -310,7 +310,7 @@ public static function tokensExpireIn(DateTimeInterface|DateInterval $date = nul
* @param \DateTimeInterface|\DateInterval|null $date
* @return \DateInterval|static
*/
public static function refreshTokensExpireIn(DateTimeInterface|DateInterval $date = null)
public static function refreshTokensExpireIn(DateTimeInterface|DateInterval|null $date = null)
{
if (is_null($date)) {
return static::$refreshTokensExpireIn ?? new DateInterval('P1Y');
Expand All @@ -329,7 +329,7 @@ public static function refreshTokensExpireIn(DateTimeInterface|DateInterval $dat
* @param \DateTimeInterface|\DateInterval|null $date
* @return \DateInterval|static
*/
public static function personalAccessTokensExpireIn(DateTimeInterface|DateInterval $date = null)
public static function personalAccessTokensExpireIn(DateTimeInterface|DateInterval|null $date = null)
{
if (is_null($date)) {
return static::$personalAccessTokensExpireIn ?? new DateInterval('P1Y');
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/AccessTokenControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public function __construct($idToken)
}

/**
* @inheritdoc
* {@inheritdoc}
*/
protected function getExtraParams(\League\OAuth2\Server\Entities\AccessTokenEntityInterface $accessToken)
{
Expand Down

0 comments on commit b06a413

Please sign in to comment.