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

@ -11,6 +11,9 @@
class ProjectUsersList extends Widget
{
/**
* @var array<string, string>
*/
protected $listeners = ['userAdded' => '$refresh'];
public Project $project;
@ -20,9 +23,12 @@ public function mount(Project $project): void
$this->project = $project;
}
/**
* @return Builder<User>
*/
protected function getTableQuery(): Builder
{
return User::query()->whereHas('projects', function (Builder $query) {
return User::query()->whereHas('projects', function (Builder $query): void {
$query->where('project_id', $this->project->id);
});
}
@ -46,10 +52,8 @@ public function table(Table $table): Table
Tables\Actions\DeleteAction::make()
->label('Remove')
->modalHeading('Remove user from project')
->visible(function ($record) {
return $this->authorize('update', $this->project)->allowed() && $record->id !== auth()->id();
})
->using(function ($record) {
->visible(fn ($record): bool => $this->authorize('update', $this->project)->allowed() && $record->id !== auth()->id())
->using(function ($record): void {
$this->project->users()->detach($record);
}),
])