Completed
Pull Request — master (#153)
by Abdul Malik
04:49
created

FastEvmProxy::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Penny\Event;
3
4
use FastEventManager\EventManager;
5
6
class FastEvmProxy implements EventManagerInterface
7
{
8
    /**
9
     * @var EventManager
10
     */
11
    private $eventManager;
12
13
    /**
14
     * Proxy EventManager
15
     */
16
    public function __construct()
17
    {
18
        $this->eventManager = new EventManager();
19
    }
20
21
    /**
22
     * {@inheritDoc}
23
     */
24
    public function trigger(EventInterface $event)
25
    {
26
        $this->eventManager->trigger($event->getName());
27
        return $this;
28
    }
29
30
    /**
31
     * {@inheritDoc}
32
     */
33
    public function attach($eventName, callable $listener, $priority = 0)
34
    {
35
        $this->eventManager->attach($eventName, $listener, $priority);
36
        return $this;
37
    }
38
}
39