CommandBus::handle()   A
last analyzed

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
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 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