Passed
Push — master ( 4e3abd...c23c95 )
by Jesse
02:09
created

CommandHandlerAdapter::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\CardGame\Infrastructure;
4
5
use function assert;
6
use Stratadox\CardGame\Command;
7
use Stratadox\CardGame\CommandHandler;
8
use Stratadox\CommandHandling\Handler;
9
10
final class CommandHandlerAdapter implements Handler
11
{
12
    /** @var CommandHandler */
13
    private $handler;
14
15
    public function __construct(CommandHandler $handler)
16
    {
17
        $this->handler = $handler;
18
    }
19
20
    public function handle(object $command): void
21
    {
22
        assert($command instanceof Command);
23
        $this->handler->handle($command);
24
    }
25
}
26