GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

HireEmployeeHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 4
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 12 1
1
<?php
2
declare(strict_types=1);
3
4
/*
5
 * This file is part of the AL labs package
6
 *
7
 * (c) Arnaud Langlade
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Al\ResourceManagement\Application\Handler;
14
15
use Al\ResourceManagement\Application\Command\HireEmployee;
16
use Al\ResourceManagement\Domain\Employee;
17
use Al\ResourceManagement\Domain\EmployeeRepositoryInterface;
18
use Ramsey\Uuid\Uuid;
19
20
final class HireEmployeeHandler
21
{
22
    /** @var EmployeeRepositoryInterface */
23
    private $employeeRepository;
24
25
    /**
26
     * @param EmployeeRepositoryInterface $employeeRepository
27
     */
28
    public function __construct(EmployeeRepositoryInterface $employeeRepository)
29
    {
30
        $this->employeeRepository = $employeeRepository;
31
    }
32
33
    /**
34
     * @param HireEmployee $command
35
     */
36
    public function handle(HireEmployee $command)
37
    {
38
        $employee = Employee::hire(
39
            Uuid::uuid4(),
40
            $command->name,
41
            $command->position,
42
            (int) $command->salaryScale,
43
            $command->hiredAt
44
        );
45
46
        $this->employeeRepository->add($employee);
47
    }
48
}
49