GetEmployeeHoursWeeklyInput   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 10 10 2

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace Scheduler\Web\Radar\Input;
4
5
use Psr\Http\Message\ServerRequestInterface as Request;
6
7 View Code Duplication
class GetEmployeeHoursWeeklyInput extends Input
8
{
9
    public function __invoke(Request $request)
10
    {
11
        $currentUser = $this->getCurrentUser($request);
12
        $employeeId = (int) $request->getAttribute('id');
13
14
        $params = $request->getQueryParams();
15
        $weekOf = isset($params["date"]) ? $params["date"] : '';
16
17
        return [$currentUser, $employeeId, $weekOf];
18
    }
19
}
20