Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function findCoworkersForShift(Shift $shift) |
||
18 | { |
||
19 | $shifts = $this->shiftMapper->findShiftsInTimePeriod( |
||
20 | $shift->getStartTime(), |
||
21 | $shift->getEndTime() |
||
22 | ); |
||
23 | |||
24 | $employee = $shift->getEmployee(); |
||
25 | |||
26 | $shifts = array_filter($shifts, function ($shift) use ($employee) { |
||
27 | return $shift->getEmployee()->getId() !== $employee->getId(); |
||
28 | }); |
||
29 | |||
30 | $coworkers = array_map(function ($shift) { |
||
31 | return $shift->getEmployee(); |
||
32 | }, $shifts); |
||
33 | |||
34 | return array_values($coworkers); |
||
35 | } |
||
36 | } |
||
37 |