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

@ -15,13 +15,23 @@ class DeploymentsList extends Widget
{
public Site $site;
/**
* @var array<string>
*/
protected $listeners = ['$refresh'];
/**
* @return Builder<Deployment>
*/
protected function getTableQuery(): Builder
{
return Deployment::query()->where('site_id', $this->site->id);
}
/**
* @param Builder<Deployment> $query
* @return Builder<Deployment>
*/
protected function applySortingToTableQuery(Builder $query): Builder
{
return $query->latest('created_at');
@ -53,6 +63,9 @@ protected function getTableColumns(): array
public function table(Table $table): Table
{
/** @var \App\Models\User */
$user = auth()->user();
return $table
->query($this->getTableQuery())
->columns($this->getTableColumns())
@ -62,14 +75,12 @@ public function table(Table $table): Table
->hiddenLabel()
->tooltip('View')
->icon('heroicon-o-eye')
->authorize(fn ($record) => auth()->user()->can('view', $record->log))
->authorize(fn ($record) => $user->can('view', $record->log))
->modalHeading('View Log')
->modalContent(function (Deployment $record) {
return view('components.console-view', [
'slot' => $record->log?->getContent(),
'attributes' => new ComponentAttributeBag,
]);
})
->modalContent(fn (Deployment $record) => view('components.console-view', [
'slot' => $record->log?->getContent(),
'attributes' => new ComponentAttributeBag,
]))
->modalSubmitAction(false)
->modalCancelActionLabel('Close'),
Action::make('download')
@ -77,7 +88,7 @@ public function table(Table $table): Table
->tooltip('Download')
->color('gray')
->icon('heroicon-o-archive-box-arrow-down')
->authorize(fn ($record) => auth()->user()->can('view', $record->log))
->authorize(fn ($record) => $user->can('view', $record->log))
->action(fn (Deployment $record) => $record->log?->download()),
]);
}