Completed
Push — develop ( 8920fe...9ca5e1 )
by Baptiste
04:17 queued 12s
created

AddAgendaHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __invoke() 0 7 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace PersonalGalaxy\Calendar\Handler;
5
6
use PersonalGalaxy\Calendar\{
7
    Command\AddAgenda,
8
    Repository\AgendaRepository,
9
    Entity\Agenda,
10
};
11
12
final class AddAgendaHandler
13
{
14
    private $repository;
15
16 1
    public function __construct(AgendaRepository $repository)
17
    {
18 1
        $this->repository = $repository;
19 1
    }
20
21 1
    public function __invoke(AddAgenda $wished): void
22
    {
23 1
        $this->repository->add(
24 1
            Agenda::add(
25 1
                $wished->identity(),
26 1
                $wished->user(),
27 1
                $wished->name()
28
            )
29
        );
30 1
    }
31
}
32