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

@ -10,22 +10,31 @@ class SelectProject extends Widget
{
protected static string $view = 'widgets.select-project';
public ?Project $currentProject;
public ?Project $currentProject = null;
/**
* @var Collection<int, Project>
*/
public Collection $projects;
public int|string|null $project;
public int|string|null $project = null;
public function mount(): void
{
$this->currentProject = auth()->user()->currentProject;
$this->projects = auth()->user()->allProjects()->get();
/** @var \App\Models\User $user */
$user = auth()->user();
$this->currentProject = $user->currentProject;
$this->projects = $user->allProjects()->get();
}
public function updateProject(Project $project): void
{
/** @var \App\Models\User $user */
$user = auth()->user();
$this->authorize('view', $project);
auth()->user()->update(['current_project_id' => $project->id]);
$user->update(['current_project_id' => $project->id]);
$this->redirect('/');
}