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

@ -29,11 +29,14 @@ public function mount(): void
protected function getHeaderActions(): array
{
/** @var \App\Models\User $user */
$user = auth()->user();
return [
Action::make('create')
->icon('heroicon-o-plus')
->modalWidth(MaxWidth::Large)
->authorize(fn () => auth()->user()?->can('create', [Backup::class, $this->server]))
->authorize(fn () => $user->can('create', [Backup::class, $this->server]))
->form([
Select::make('database')
->label('Database')
@ -52,7 +55,7 @@ protected function getHeaderActions(): array
->icon('heroicon-o-wifi')
->tooltip('Connect to a new storage provider')
->modalWidth(MaxWidth::Medium)
->authorize(fn () => auth()->user()->can('create', StorageProvider::class))
->authorize(fn () => $user->can('create', StorageProvider::class))
->action(fn (array $data) => Create::action($data))
),
Select::make('interval')
@ -63,7 +66,7 @@ protected function getHeaderActions(): array
TextInput::make('custom_interval')
->label('Custom Interval (Cron)')
->rules(fn (callable $get) => ManageBackup::rules($this->server, $get())['custom_interval'])
->visible(fn (callable $get) => $get('interval') === 'custom')
->visible(fn (callable $get): bool => $get('interval') === 'custom')
->placeholder('0 * * * *'),
TextInput::make('keep')
->label('Backups to Keep')
@ -71,8 +74,8 @@ protected function getHeaderActions(): array
->helperText('How many backups to keep before deleting the oldest one'),
])
->modalSubmitActionLabel('Create')
->action(function (array $data) {
run_action($this, function () use ($data) {
->action(function (array $data): void {
run_action($this, function () use ($data): void {
app(ManageBackup::class)->create($this->server, $data);
$this->dispatch('$refresh');