entries->week($userId, $monday); return new WeekHours($monday, $sheet->dayTotals, $sheet->totalQuarters, $sheet->unapprovedQuarters); } public function pendingApprovals(): array { $people = []; foreach ($this->entries->pendingWeeks() as $week) { $current = $people[$week->userId] ?? new PendingApproval($week->userId, $week->userName, 0, 0); $people[$week->userId] = new PendingApproval($week->userId, $week->userName, $current->quarters + $week->quarters, $current->weekCount + 1); } $people = array_values($people); usort($people, fn (PendingApproval $a, PendingApproval $b): int => strnatcasecmp($a->name, $b->name)); return $people; } }