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

@ -17,8 +17,14 @@ class SshKeysList extends TableWidget
{
public Server $server;
/**
* @var array<string>
*/
protected $listeners = ['$refresh'];
/**
* @return Builder<SshKey>
*/
protected function getTableQuery(): Builder
{
return SshKey::withTrashed()
@ -44,6 +50,9 @@ protected function getTableColumns(): array
public function table(Table $table): Table
{
/** @var \App\Models\User $user */
$user = auth()->user();
return $table
->heading(null)
->query($this->getTableQuery())
@ -51,8 +60,8 @@ public function table(Table $table): Table
->actions([
DeleteAction::make('delete')
->hiddenLabel()
->authorize(fn (SshKey $record) => auth()->user()->can('deleteServer', [SshKey::class, $this->server]))
->using(function (SshKey $record) {
->authorize(fn (SshKey $record) => $user->can('deleteServer', [SshKey::class, $this->server]))
->using(function (SshKey $record): void {
try {
app(DeleteKeyFromServer::class)->delete($this->server, $record);
} catch (Exception $e) {