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,8 +15,14 @@ class DatabasesList extends Widget
{
public Server $server;
/**
* @var array<string>
*/
protected $listeners = ['$refresh'];
/**
* @return Builder<Database>
*/
protected function getTableQuery(): Builder
{
return Database::query()->where('server_id', $this->server->id);
@ -47,6 +53,9 @@ protected function getTableColumns(): array
public function table(Table $table): Table
{
/** @var \App\Models\User */
$user = auth()->user();
return $table
->heading(null)
->query($this->getTableQuery())
@ -58,10 +67,10 @@ public function table(Table $table): Table
->modalHeading('Delete Database')
->color('danger')
->tooltip('Delete')
->authorize(fn ($record) => auth()->user()->can('delete', $record))
->authorize(fn ($record) => $user->can('delete', $record))
->requiresConfirmation()
->action(function (Database $record) {
run_action($this, function () use ($record) {
->action(function (Database $record): void {
run_action($this, function () use ($record): void {
app(DeleteDatabase::class)->delete($this->server, $record);
$this->dispatch('$refresh');
});