AddSubscriptionHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

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\RSS\Handler;
5
6
use PersonalGalaxy\RSS\{
7
    Command\AddSubscription,
8
    Entity\Subscription,
9
    Repository\SubscriptionRepository,
10
};
11
12
final class AddSubscriptionHandler
13
{
14
    private $repository;
15
16 1
    public function __construct(SubscriptionRepository $repository)
17
    {
18 1
        $this->repository = $repository;
19 1
    }
20
21 1
    public function __invoke(AddSubscription $wished): void
22
    {
23 1
        $this->repository->add(Subscription::add(
24 1
            $wished->identity(),
25 1
            $wished->user(),
26 1
            $wished->name(),
27 1
            $wished->location()
28
        ));
29 1
    }
30
}
31