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

AddAgendaHandler::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 7
ccs 6
cts 6
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
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