Skip to content

Commit fbb59fc

Browse files
Fix depricated warning on PHP 8.4
1 parent 4ea5a6e commit fbb59fc

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

src/Commands/Concerns/HasSubModule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected function handleReplacements(string $location, array $replacements): vo
2222
}
2323
}
2424

25-
protected function replacementSubModule(string $file = null, $content = null): string
25+
protected function replacementSubModule(?string $file = null, $content = null): string
2626
{
2727
$name = strtolower($this->argument('name'));
2828

src/Commands/PluginCreateCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ protected function handlerError(): void
341341
$this->components->error('Plugin ID does not match the pattern: (ex: <vendor>/<name>)');
342342
}
343343

344-
protected function bootServiceProviderContent(): string|null
344+
protected function bootServiceProviderContent(): ?string
345345
{
346346
$componentAvailableOfPlugins = $this->componentAvailableOfPlugins;
347347

@@ -384,7 +384,7 @@ protected function bootServiceProviderContent(): string|null
384384
->toString();
385385
}
386386

387-
protected function registerAdvancedLanguage(): string|null
387+
protected function registerAdvancedLanguage(): ?string
388388
{
389389
if (! $this->hasCrud) {
390390
return null;
@@ -397,7 +397,7 @@ protected function registerAdvancedLanguage(): string|null
397397
}", Str::studly($this->argument('name')));
398398
}
399399

400-
protected function registerDashboardMenuContent(): string|null
400+
protected function registerDashboardMenuContent(): ?string
401401
{
402402
if (! $this->hasCrud) {
403403
return null;
@@ -418,7 +418,7 @@ protected function registerDashboardMenuContent(): string|null
418418
return PHP_EOL . str_repeat(' ', 12) . str_replace('{-name}', strtolower($this->argument('name')), $rawContent);
419419
}
420420

421-
protected function importsServiceProvider(): string|null
421+
protected function importsServiceProvider(): ?string
422422
{
423423
if (! $this->hasCrud) {
424424
return null;

src/Commands/RebuildPermissionsCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public function handle(): int
2424
$users = User::query()->get();
2525
foreach ($users as $user) {
2626
$user->permissions = [
27-
ACL_ROLE_SUPER_USER => (bool)$user->super_user,
28-
ACL_ROLE_MANAGE_SUPERS => (bool)$user->manage_supers,
27+
ACL_ROLE_SUPER_USER => (bool) $user->super_user,
28+
ACL_ROLE_MANAGE_SUPERS => (bool) $user->manage_supers,
2929
];
3030
$user->save();
3131
}
@@ -41,8 +41,8 @@ public function handle(): int
4141
);
4242
if (! empty($user)) {
4343
$user = $user[0];
44-
$permissions[ACL_ROLE_SUPER_USER] = (bool)$user->super_user;
45-
$permissions[ACL_ROLE_MANAGE_SUPERS] = (bool)$user->manage_supers;
44+
$permissions[ACL_ROLE_SUPER_USER] = (bool) $user->super_user;
45+
$permissions[ACL_ROLE_MANAGE_SUPERS] = (bool) $user->manage_supers;
4646
DB::statement(
4747
"UPDATE users SET permissions = '" . json_encode(
4848
$permissions

src/Commands/ThemeCreateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ThemeCreateCommand extends BaseMakeCommand implements PromptsForMissingInp
2020
{
2121
use ThemeTrait;
2222

23-
protected string|null $parentTheme;
23+
protected ?string $parentTheme;
2424

2525
public function __construct(protected ThemeService $themeService)
2626
{

src/Providers/CommandServiceProvider.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
use Botble\DevTool\Commands\ThemeCreateCommand;
2727
use Botble\DevTool\Commands\WidgetCreateCommand;
2828
use Botble\DevTool\Commands\WidgetRemoveCommand;
29+
use Botble\PluginManagement\Providers\PluginManagementServiceProvider;
30+
use Botble\Theme\Providers\ThemeServiceProvider;
31+
use Botble\Widget\Providers\WidgetServiceProvider;
2932

3033
class CommandServiceProvider extends ServiceProvider
3134
{
@@ -61,20 +64,20 @@ public function boot(): void
6164
]);
6265
}
6366

64-
if (class_exists(\Botble\PluginManagement\Providers\PluginManagementServiceProvider::class)) {
67+
if (class_exists(PluginManagementServiceProvider::class)) {
6568
$this->commands([
6669
PluginCreateCommand::class,
6770
PluginMakeCrudCommand::class,
6871
]);
6972
}
7073

71-
if (class_exists(\Botble\Theme\Providers\ThemeServiceProvider::class)) {
74+
if (class_exists(ThemeServiceProvider::class)) {
7275
$this->commands([
7376
ThemeCreateCommand::class,
7477
]);
7578
}
7679

77-
if (class_exists(\Botble\Widget\Providers\WidgetServiceProvider::class)) {
80+
if (class_exists(WidgetServiceProvider::class)) {
7881
$this->commands([
7982
WidgetCreateCommand::class,
8083
WidgetRemoveCommand::class,

0 commit comments

Comments
 (0)