UpdateShiftInput   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 2
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 13 5
1
<?php
2
3
namespace Scheduler\Web\Radar\Input;
4
5
use Psr\Http\Message\ServerRequestInterface as Request;
6
7
class UpdateShiftInput extends Input
8
{
9
    public function __invoke(Request $request)
10
    {
11
        $currentUser = $this->getCurrentUser($request);
12
        $shiftId = (int) $request->getAttribute('id');
13
14
        $body = $request->getParsedBody();
15
        $employeeId = isset($body->employee_id) ? (int) $body->employee_id : null;
16
        $start = isset($body->start_time) ? $body->start_time : '';
17
        $end = isset($body->end_time) ? $body->end_time : '';
18
        $break = isset($body->break) ? $body->break : '';
19
20
        return [$currentUser, $shiftId, $employeeId, $start, $end, $break];
21
    }
22
}
23