SimpleBusUserEventBus   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\EventBus;
14
15
use BenGorUser\User\Domain\Model\Event\UserEvent;
16
use BenGorUser\User\Infrastructure\Domain\Model\UserEventBus;
17
use SimpleBus\Message\Bus\MessageBus;
18
19
/**
20
 * Simple bus implementation of user event bus.
21
 *
22
 * @author Beñat Espiña <[email protected]>
23
 */
24
class SimpleBusUserEventBus implements UserEventBus
25
{
26
    /**
27
     * The message bus.
28
     *
29
     * @var MessageBus
30
     */
31
    private $messageBus;
32
33
    /**
34
     * Constructor.
35
     *
36
     * @param MessageBus $aMessageBus The message bus
37
     */
38
    public function __construct(MessageBus $aMessageBus)
39
    {
40
        $this->messageBus = $aMessageBus;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function handle(UserEvent $anEvent)
47
    {
48
        $this->messageBus->handle($anEvent);
49
    }
50
}
51