Completed
Push — master ( a4f973...4e0df9 )
by Nicolas
9s
created

CommandBus   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 12
c 0
b 0
f 0
wmc 2
lcom 1
cbo 1
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 6 2
1
<?php
2
declare(strict_types=1);
3
4
namespace BSP;
5
6
abstract class CommandBus
7
{
8
    /** @var CommandHandler[] */
9
    protected $handlers = [];
10
11 1
    public function execute(Command $command): void
12
    {
13 1
        if (isset($this->handlers[get_class($command)])) {
14 1
            $this->handlers[get_class($command)]->handle($command);
15
        }
16 1
    }
17
}
18