Skip to content

Commit

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

* wip

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

---------

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone authored Nov 21, 2024
1 parent 6fa9c8e commit e4d2d10
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.2, 8.3]
php: [8.2, 8.3, 8.4]
laravel: [11]

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
Expand All @@ -36,9 +36,8 @@ 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 --display-deprecations --fail-on-deprecation

2 changes: 1 addition & 1 deletion src/Contracts/HasApiTokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function tokenCan(string $ability);
* @param \DateTimeInterface|null $expiresAt
* @return \Laravel\Sanctum\NewAccessToken
*/
public function createToken(string $name, array $abilities = ['*'], DateTimeInterface $expiresAt = null);
public function createToken(string $name, array $abilities = ['*'], ?DateTimeInterface $expiresAt = null);

/**
* Get the access token currently associated with the user.
Expand Down
2 changes: 1 addition & 1 deletion src/Guard.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ protected function getTokenFromRequest(Request $request)
* @param string|null $token
* @return bool
*/
protected function isValidBearerToken(string $token = null)
protected function isValidBearerToken(?string $token = null)
{
if (! is_null($token) && str_contains($token, '|')) {
$model = new Sanctum::$personalAccessTokenModel;
Expand Down
2 changes: 1 addition & 1 deletion src/HasApiTokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function tokenCan(string $ability)
* @param \DateTimeInterface|null $expiresAt
* @return \Laravel\Sanctum\NewAccessToken
*/
public function createToken(string $name, array $abilities = ['*'], DateTimeInterface $expiresAt = null)
public function createToken(string $name, array $abilities = ['*'], ?DateTimeInterface $expiresAt = null)
{
$plainTextToken = $this->generateTokenString();

Expand Down

0 comments on commit e4d2d10

Please sign in to comment.