SimpleBusUserCommandBus   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the BenGorUser package.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 * (c) Gorka Laucirica <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace BenGorUser\SimpleBusBridge\CommandBus;
14
15
use BenGorUser\User\Infrastructure\CommandBus\UserCommandBus;
16
use SimpleBus\Message\Bus\MessageBus;
17
18
/**
19
 * Simple bus implementation of user command bus.
20
 *
21
 * @author Beñat Espiña <[email protected]>
22
 */
23
class SimpleBusUserCommandBus implements UserCommandBus
24
{
25
    /**
26
     * The message bus.
27
     *
28
     * @var MessageBus
29
     */
30
    private $messageBus;
31
32
    /**
33
     * Constructor.
34
     *
35
     * @param MessageBus $aMessageBus The message bus
36
     */
37
    public function __construct(MessageBus $aMessageBus)
38
    {
39
        $this->messageBus = $aMessageBus;
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function handle($aCommand)
46
    {
47
        $this->messageBus->handle($aCommand);
48
    }
49
}
50