Apply suggestions from code review

Co-authored-by: Krzysztof Rewak <krzysztof.rewak@gmail.com>
This commit is contained in:
Adrian Hopek 2022-04-26 10:35:11 +02:00 committed by GitHub
parent 4ecabeba0d
commit cbfc2b0c45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -22,7 +22,7 @@ class DailySummaryRetriever
->with(["user", "vacationRequest"]) ->with(["user", "vacationRequest"])
->whereDate("date", $date) ->whereDate("date", $date)
->approved() ->approved()
->whereTypes(VacationType::all()->filter(fn(VacationType $type) => $this->configRetriever->isVacation($type))) ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => $this->configRetriever->isVacation($type)))
->get(); ->get();
} }
@ -32,7 +32,7 @@ class DailySummaryRetriever
->with(["user", "vacationRequest"]) ->with(["user", "vacationRequest"])
->whereDate("date", $date) ->whereDate("date", $date)
->approved() ->approved()
->whereTypes(VacationType::all()->filter(fn(VacationType $type) => !$this->configRetriever->isVacation($type))) ->whereTypes(VacationType::all()->filter(fn(VacationType $type): bool => !$this->configRetriever->isVacation($type)))
->get(); ->get();
} }

View File

@ -24,13 +24,13 @@ class DailySummary extends SignatureHandler
$now = Carbon::today(); $now = Carbon::today();
$absences = $dailySummaryRetriever->getAbsences($now) $absences = $dailySummaryRetriever->getAbsences($now)
->map(fn(Vacation $vacation) => $vacation->user->profile->full_name); ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);
$remoteDays = $dailySummaryRetriever->getRemoteDays($now) $remoteDays = $dailySummaryRetriever->getRemoteDays($now)
->map(fn(Vacation $vacation) => $vacation->user->profile->full_name); ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name);
$birthdays = $dailySummaryRetriever->getBirthdays($now) $birthdays = $dailySummaryRetriever->getBirthdays($now)
->map(fn(User $user) => $user->profile->full_name); ->map(fn(User $user): string => $user->profile->full_name);
$absencesAttachment = Attachment::create() $absencesAttachment = Attachment::create()
->setTitle("Nieobecności :sunny:") ->setTitle("Nieobecności :sunny:")