Skip to content

Commit e2fd3ba

Browse files
Fix depricated warning on PHP 8.4
1 parent a669f77 commit e2fd3ba

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Http/Middleware/ForceJsonResponseMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function handle(Request $request, Closure $next)
1515

1616
if ($request->bearerToken()) {
1717
$user = Auth::guard('sanctum')->user();
18-
18+
1919
if ($user && $user instanceof Authenticatable) {
2020
Auth::setUser($user);
2121
}

src/Providers/ApiServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Botble\Api\Providers;
44

5-
use Botble\Api\Facades\ApiHelper;
65
use Botble\Api\Commands\GenerateDocumentationCommand;
6+
use Botble\Api\Facades\ApiHelper;
77
use Botble\Api\Http\Middleware\ForceJsonResponseMiddleware;
88
use Botble\Api\Models\PersonalAccessToken;
99
use Botble\Base\Facades\PanelSectionManager;
@@ -96,7 +96,7 @@ public function boot(): void
9696
});
9797
}
9898

99-
protected function getPath(string|null $path = null): string
99+
protected function getPath(?string $path = null): string
100100
{
101101
return __DIR__ . '/../..' . ($path ? '/' . ltrim($path, '/') : '');
102102
}

src/Supports/ApiHelper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ApiHelper
1010
{
1111
public function modelName(): string
1212
{
13-
return (string)$this->getConfig('model', User::class);
13+
return (string) $this->getConfig('model', User::class);
1414
}
1515

1616
public function setModelName(string $modelName): self
@@ -20,17 +20,17 @@ public function setModelName(string $modelName): self
2020
return $this;
2121
}
2222

23-
public function guard(): string|null
23+
public function guard(): ?string
2424
{
2525
return $this->getConfig('guard');
2626
}
2727

28-
public function passwordBroker(): string|null
28+
public function passwordBroker(): ?string
2929
{
3030
return $this->getConfig('password_broker');
3131
}
3232

33-
public function getConfig(string $key, $default = null): string|null
33+
public function getConfig(string $key, $default = null): ?string
3434
{
3535
return config('packages.api.api.provider.' . $key, $default);
3636
}

0 commit comments

Comments
 (0)