Passed
Push — master ( 5eb093...9c3882 )
by Tomasz
01:52
created

UseCase::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Aggrego\Domain\Api\Command\DeleteBoard;
4
5
use Aggrego\Domain\Model\ProgressBoard\Repository;
6
use Aggrego\Domain\ValueObject\Uuid;
7
8
class UseCase
9
{
10
    /** @var Repository */
11
    private $repository;
12
13
    public function __construct(Repository $repository)
14
    {
15
        $this->repository = $repository;
16
    }
17
18
    public function handle(Command $command): void
19
    {
20
        $uuid = new Uuid($command->getBoardUuid());
21
        $board = $this->repository->getBoardByUuid($uuid);
22
        $board->markAsDeleted();
23
    }
24
}
25