Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function __invoke(User $currentUser, $employeeId) |
||
22 | { |
||
23 | if (! $currentUser->isAuthenticated()) { |
||
24 | return $this->payload->setStatus(Payload::NOT_AUTHENTICATED); |
||
25 | } |
||
26 | |||
27 | $employee = $this->userMapper->find($employeeId); |
||
28 | |||
29 | if ($employee === null) { |
||
30 | return $this->payload->setStatus(Payload::NOT_FOUND); |
||
31 | } |
||
32 | |||
33 | return $this->payload->setStatus(Payload::SUCCESS) |
||
34 | ->setOutput($employee); |
||
35 | } |
||
36 | } |
||
37 |