mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 23:42:34 +00:00
Add phpstan level 7(#544)
This commit is contained in:
@ -21,6 +21,9 @@ class ServerDetails extends Widget implements HasForms, HasInfolists
|
||||
use InteractsWithForms;
|
||||
use InteractsWithInfolists;
|
||||
|
||||
/**
|
||||
* @var array<string>
|
||||
*/
|
||||
protected $listeners = ['$refresh'];
|
||||
|
||||
protected static bool $isLazy = false;
|
||||
@ -55,7 +58,7 @@ public function infolist(Infolist $infolist): Infolist
|
||||
Action::make('check-update')
|
||||
->icon('heroicon-o-arrow-path')
|
||||
->tooltip('Check Now')
|
||||
->action(function (Server $record) {
|
||||
->action(function (Server $record): void {
|
||||
$record->checkForUpdates();
|
||||
|
||||
$this->dispatch('$refresh');
|
||||
@ -63,7 +66,7 @@ public function infolist(Infolist $infolist): Infolist
|
||||
Notification::make()
|
||||
->info()
|
||||
->title('Available updates:')
|
||||
->body($record->updates)
|
||||
->body((string) $record->updates)
|
||||
->send();
|
||||
})
|
||||
),
|
||||
@ -75,7 +78,7 @@ public function infolist(Infolist $infolist): Infolist
|
||||
->icon('heroicon-o-check-circle')
|
||||
->tooltip('Update Now')
|
||||
->requiresConfirmation()
|
||||
->action(function (Server $record) {
|
||||
->action(function (Server $record): void {
|
||||
app(Update::class)->update($record);
|
||||
|
||||
$this->dispatch('$refresh');
|
||||
@ -91,11 +94,11 @@ public function infolist(Infolist $infolist): Infolist
|
||||
->inlineLabel(),
|
||||
TextEntry::make('tags.*')
|
||||
->default('No tags')
|
||||
->formatStateUsing(fn ($state) => is_object($state) ? $state->name : $state)
|
||||
->formatStateUsing(fn ($state) => is_object($state) && isset($state->name) ? $state->name : $state)
|
||||
->inlineLabel()
|
||||
->badge()
|
||||
->color(fn ($state) => is_object($state) ? $state->color : 'gray')
|
||||
->icon(fn ($state) => is_object($state) ? 'heroicon-o-tag' : '')
|
||||
->color(fn ($state) => is_object($state) && isset($state->color) ? $state->color : 'gray')
|
||||
->icon(fn ($state): string => is_object($state) ? 'heroicon-o-tag' : '')
|
||||
->suffixAction(
|
||||
EditTags::infolist($this->server)
|
||||
),
|
||||
|
Reference in New Issue
Block a user