From cbfc2b0c45921fe3c97bc8283557157cdfecbe16 Mon Sep 17 00:00:00 2001 From: Adrian Hopek Date: Tue, 26 Apr 2022 10:35:11 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Krzysztof Rewak --- app/Domain/DailySummaryRetriever.php | 4 ++-- app/Domain/Slack/Handlers/DailySummary.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Domain/DailySummaryRetriever.php b/app/Domain/DailySummaryRetriever.php index 465cdb4..4049738 100644 --- a/app/Domain/DailySummaryRetriever.php +++ b/app/Domain/DailySummaryRetriever.php @@ -22,7 +22,7 @@ class DailySummaryRetriever ->with(["user", "vacationRequest"]) ->whereDate("date", $date) ->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(); } @@ -32,7 +32,7 @@ class DailySummaryRetriever ->with(["user", "vacationRequest"]) ->whereDate("date", $date) ->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(); } diff --git a/app/Domain/Slack/Handlers/DailySummary.php b/app/Domain/Slack/Handlers/DailySummary.php index c69334f..8a33f80 100644 --- a/app/Domain/Slack/Handlers/DailySummary.php +++ b/app/Domain/Slack/Handlers/DailySummary.php @@ -24,13 +24,13 @@ class DailySummary extends SignatureHandler $now = Carbon::today(); $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) - ->map(fn(Vacation $vacation) => $vacation->user->profile->full_name); + ->map(fn(Vacation $vacation): string => $vacation->user->profile->full_name); $birthdays = $dailySummaryRetriever->getBirthdays($now) - ->map(fn(User $user) => $user->profile->full_name); + ->map(fn(User $user): string => $user->profile->full_name); $absencesAttachment = Attachment::create() ->setTitle("Nieobecności :sunny:")