Add phpstan level 7(#544)

This commit is contained in:
Saeed Vaziry
2025-03-12 13:31:10 +01:00
committed by GitHub
parent c22bb1fa80
commit 493cbb0849
437 changed files with 4505 additions and 2193 deletions

View File

@ -57,13 +57,13 @@ protected function getHeaderActions(): array
return [];
}
return collect(config("core.service_versions.{$get('name')}"))
return collect((array) config("core.service_versions.{$get('name')}"))
->mapWithKeys(fn ($version) => [$version => $version]);
})
->rules(fn ($get) => Install::rules($get())['version'])
->reactive(),
])
->action(function (array $data) {
->action(function (array $data): void {
$this->validate();
try {

View File

@ -21,8 +21,14 @@ class ServicesList extends TableWidget
{
public Server $server;
/**
* @var array<string>
*/
protected $listeners = ['$refresh'];
/**
* @return Builder<Service>
*/
protected function getTableQuery(): Builder
{
return Service::query()->where('server_id', $this->server->id);
@ -33,7 +39,7 @@ protected function getTableColumns(): array
return [
IconColumn::make('id')
->label('Service')
->icon(fn (Service $record) => 'icon-'.$record->name)
->icon(fn (Service $record): string => 'icon-'.$record->name)
->width(24),
TextColumn::make('name')
->sortable(),
@ -78,7 +84,7 @@ private function serviceAction(string $type, string $icon): Action
->authorize(fn (Service $service) => auth()->user()?->can($type, $service))
->label(ucfirst($type).' Service')
->icon($icon)
->action(function (Service $service) use ($type) {
->action(function (Service $service) use ($type): void {
try {
app(Manage::class)->$type($service);
} catch (Exception $e) {
@ -102,7 +108,7 @@ private function uninstallAction(): Action
->icon('heroicon-o-trash')
->color('danger')
->requiresConfirmation()
->action(function (Service $service) {
->action(function (Service $service): void {
try {
app(Uninstall::class)->uninstall($service);