Apply suggestions from code review

Co-authored-by: Krzysztof Rewak <krzysztof.rewak@gmail.com>
Co-authored-by: Ewelina Lasowy <56546832+EwelinaLasowy@users.noreply.github.com>
This commit is contained in:
Adrian Hopek 2022-04-14 11:35:00 +02:00 committed by GitHub
parent 4059b101f5
commit ab92f285ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -54,14 +54,14 @@ class HandleInertiaRequests extends Middleware
protected function getYearsData(Request $request): Closure protected function getYearsData(Request $request): Closure
{ {
return fn() => $request->user() ? $this->yearPeriodRetriever->links() : []; return fn(): array => $request->user() ? $this->yearPeriodRetriever->links() : [];
} }
protected function getVacationRequestsCount(Request $request): Closure protected function getVacationRequestsCount(Request $request): Closure
{ {
$user = $request->user(); $user = $request->user();
return fn() => $user && $user->can("listAll", VacationRequest::class) return fn(): ?int => $user && $user->can("listAll", VacationRequest::class)
? VacationRequest::query() ? VacationRequest::query()
->whereBelongsTo($this->yearPeriodRetriever->selected()) ->whereBelongsTo($this->yearPeriodRetriever->selected())
->states( ->states(