CommandBus   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
/*
4
 * cqrs-tactician (https://github.com/phpgears/cqrs-tactician).
5
 * CQRS implementation with League Tactician.
6
 *
7
 * @license MIT
8
 * @link https://github.com/phpgears/cqrs-tactician
9
 * @author Julián Gutiérrez <[email protected]>
10
 */
11
12
declare(strict_types=1);
13
14
namespace Gears\CQRS\Tactician;
15
16
use Gears\CQRS\Command;
17
use Gears\CQRS\CommandBus as CommandBusInterface;
18
use League\Tactician\CommandBus as TacticianCommandBus;
19
20
final class CommandBus implements CommandBusInterface
21
{
22
    /**
23
     * Wrapped command bus.
24
     *
25
     * @var TacticianCommandBus
26
     */
27
    private $wrappedCommandBus;
28
29
    /**
30
     * CommandBus constructor.
31
     *
32
     * @param TacticianCommandBus $wrappedCommandBus
33
     */
34
    public function __construct(TacticianCommandBus $wrappedCommandBus)
35
    {
36
        $this->wrappedCommandBus = $wrappedCommandBus;
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function handle(Command $command): void
43
    {
44
        $this->wrappedCommandBus->handle($command);
45
    }
46
}
47