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::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 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