UserEventSubscriber   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 39
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 4 1
A isSubscribedTo() 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\CarlosBuenosvinosDddBridge\Domain\Event;
14
15
use BenGorUser\CarlosBuenosvinosDddBridge\Domain\Model\UserEvent;
16
use BenGorUser\User\Domain\Event\UserEventSubscriber as BaseUserEventSubscriber;
17
use Ddd\Domain\DomainEventSubscriber;
18
19
/**
20
 * User event subscriber class.
21
 *
22
 * @author Beñat Espiña <[email protected]>
23
 */
24
class UserEventSubscriber implements DomainEventSubscriber
25
{
26
    /**
27
     * The domain event subscriber.
28
     *
29
     * @var BaseUserEventSubscriber
30
     */
31
    private $subscriber;
32
33
    /**
34
     * Constructor.
35
     *
36
     * @param BaseUserEventSubscriber $aSubscriber The domain event subscriber
37
     */
38
    public function __construct(BaseUserEventSubscriber $aSubscriber)
39
    {
40
        $this->subscriber = $aSubscriber;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     *
46
     * @param UserEvent $aDomainEvent The domain event
47
     */
48
    public function handle($aDomainEvent)
49
    {
50
        $this->subscriber->handle($aDomainEvent->event());
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     *
56
     * @param UserEvent $aDomainEvent The domain event
57
     */
58
    public function isSubscribedTo($aDomainEvent)
59
    {
60
        return $this->subscriber->isSubscribedTo($aDomainEvent->event());
61
    }
62
}
63