Skip to content

Commit

Permalink
PHP Stan Level 5
Browse files Browse the repository at this point in the history
  • Loading branch information
adrolli committed Dec 15, 2023
1 parent 1bf5c2b commit 02bb256
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 870 deletions.
10 changes: 0 additions & 10 deletions _other/builder/src/BuilderPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,6 @@ public static function make(): static
return app(static::class);
}

/**
* Get the plugin instance.
*/
public static function get(): static
{
$id = app(static::class)->getId();

return app(static::class);
}

/**
* Get the resource class.
*/
Expand Down
16 changes: 8 additions & 8 deletions _other/builder/src/Resources/BuilderResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ public static function getWidgets(): array

public static function getNavigationBadge(): ?string
{
return BuilderPlugin::get()->getNavigationCountBadge() ? number_format(static::getModel()::count()) : null;
return BuilderPlugin::make()->getNavigationCountBadge() ? number_format(static::getModel()::count()) : null;
}

public static function getModelLabel(): string
{
return BuilderPlugin::get()->getLabel();
return BuilderPlugin::make()->getLabel();
}

public static function getPluralModelLabel(): string
{
return BuilderPlugin::get()->getPluralLabel();
return BuilderPlugin::make()->getPluralLabel();
}

public static function getNavigationLabel(): string
Expand All @@ -101,26 +101,26 @@ public static function getNavigationLabel(): string

public static function getNavigationGroup(): ?string
{
return BuilderPlugin::get()->getNavigationGroup();
return BuilderPlugin::make()->getNavigationGroup();
}

public static function getNavigationSort(): ?int
{
return BuilderPlugin::get()->getNavigationSort();
return BuilderPlugin::make()->getNavigationSort();
}

public static function getBreadcrumb(): string
{
return BuilderPlugin::get()->getBreadcrumb();
return BuilderPlugin::make()->getBreadcrumb();
}

public static function shouldRegisterNavigation(): bool
{
return BuilderPlugin::get()->shouldRegisterNavigation();
return BuilderPlugin::make()->shouldRegisterNavigation();
}

public static function getNavigationIcon(): string
{
return BuilderPlugin::get()->getNavigationIcon();
return BuilderPlugin::make()->getNavigationIcon();
}
}
2 changes: 1 addition & 1 deletion _packages/jobs/src/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class InstallCommand extends Command
/**
* Execute the console command.
*/
public function handle()
public function handle(): void
{
$this->comment('Publishing Jobs Configuration...');
$this->callSilent('vendor:publish', ['--tag' => 'jobs-config']);
Expand Down
2 changes: 1 addition & 1 deletion _packages/jobs/src/Traits/FormatSeconds.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

trait FormatSeconds
{
public function formatSeconds($seconds)
public function formatSeconds(int $seconds): string
{
$days = floor($seconds / (60 * 60 * 24));
$seconds -= $days * (60 * 60 * 24);
Expand Down
10 changes: 0 additions & 10 deletions _packages/page/src/PagePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,6 @@ public static function make(): static
return app(static::class);
}

/**
* Get the plugin instance.
*/
public static function get(): static
{
$id = app(static::class)->getId();

return app(static::class);
}

/**
* Get the resource class.
*/
Expand Down
16 changes: 8 additions & 8 deletions _packages/page/src/Resources/PageResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ public static function getWidgets(): array

public static function getNavigationBadge(): ?string
{
return PagePlugin::get()->getNavigationCountBadge() ? number_format(static::getModel()::count()) : null;
return PagePlugin::make()->getNavigationCountBadge() ? number_format(static::getModel()::count()) : null;
}

public static function getModelLabel(): string
{
return PagePlugin::get()->getLabel();
return PagePlugin::make()->getLabel();
}

public static function getPluralModelLabel(): string
{
return PagePlugin::get()->getPluralLabel();
return PagePlugin::make()->getPluralLabel();
}

public static function getNavigationLabel(): string
Expand All @@ -101,26 +101,26 @@ public static function getNavigationLabel(): string

public static function getNavigationGroup(): ?string
{
return PagePlugin::get()->getNavigationGroup();
return PagePlugin::make()->getNavigationGroup();
}

public static function getNavigationSort(): ?int
{
return PagePlugin::get()->getNavigationSort();
return PagePlugin::make()->getNavigationSort();
}

public static function getBreadcrumb(): string
{
return PagePlugin::get()->getBreadcrumb();
return PagePlugin::make()->getBreadcrumb();
}

public static function shouldRegisterNavigation(): bool
{
return PagePlugin::get()->shouldRegisterNavigation();
return PagePlugin::make()->shouldRegisterNavigation();
}

public static function getNavigationIcon(): string
{
return PagePlugin::get()->getNavigationIcon();
return PagePlugin::make()->getNavigationIcon();
}
}
16 changes: 8 additions & 8 deletions _packages/user/src/Resources/UserResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,17 @@ public static function getPages(): array

public static function getNavigationBadge(): ?string
{
return UserPlugin::get()->getNavigationCountBadge() ? number_format(static::getModel()::count()) : null;
return UserPlugin::make()->getNavigationCountBadge() ? number_format(static::getModel()::count()) : null;
}

public static function getModelLabel(): string
{
return UserPlugin::get()->getLabel();
return UserPlugin::make()->getLabel();
}

public static function getPluralModelLabel(): string
{
return UserPlugin::get()->getPluralLabel();
return UserPlugin::make()->getPluralLabel();
}

public static function getNavigationLabel(): string
Expand All @@ -145,26 +145,26 @@ public static function getNavigationLabel(): string

public static function getNavigationGroup(): ?string
{
return UserPlugin::get()->getNavigationGroup();
return UserPlugin::make()->getNavigationGroup();
}

public static function getNavigationSort(): ?int
{
return UserPlugin::get()->getNavigationSort();
return UserPlugin::make()->getNavigationSort();
}

public static function getBreadcrumb(): string
{
return UserPlugin::get()->getBreadcrumb();
return UserPlugin::make()->getBreadcrumb();
}

public static function shouldRegisterNavigation(): bool
{
return UserPlugin::get()->shouldRegisterNavigation();
return UserPlugin::make()->shouldRegisterNavigation();
}

public static function getNavigationIcon(): string
{
return UserPlugin::get()->getNavigationIcon();
return UserPlugin::make()->getNavigationIcon();
}
}
10 changes: 0 additions & 10 deletions _packages/user/src/UserPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,6 @@ public static function make(): static
return app(static::class);
}

/**
* Get the plugin instance.
*/
public static function get(): static
{
$id = app(static::class)->getId();

return app(static::class);
}

/**
* Get the resource class.
*/
Expand Down
108 changes: 0 additions & 108 deletions app/Policies/BlogPolicy.php

This file was deleted.

Loading

0 comments on commit 02bb256

Please sign in to comment.