ZendEvmProxy   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 1 Features 1
Metric Value
wmc 4
c 4
b 1
f 1
lcom 1
cbo 1
dl 0
loc 36
ccs 11
cts 11
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A trigger() 0 8 2
A attach() 0 5 1
1
<?php
2
namespace Penny\Event;
3
4
use Zend\EventManager\EventInterface as ZendEventInterface;
5
use Zend\EventManager\EventManager;
6
7
class ZendEvmProxy implements EventManagerInterface
8
{
9
    /**
10
     * @var EventManager
11
     */
12
    private $eventManager;
13
14
    /**
15
     * Proxy Zend\EventManager\EventManager
16
     */
17 19
    public function __construct()
18
    {
19 19
        $this->eventManager = new EventManager();
20 19
    }
21
22
    /**
23
     * {@inheritDoc}
24
     */
25 14
    public function trigger(EventInterface $event)
26
    {
27 14
        if ($event instanceof ZendEventInterface) {
28 14
            $this->eventManager->trigger($event);
29 14
        }
30
31 14
        return $this;
32
    }
33
34
    /**
35
     * {@inheritDoc}
36
     */
37 19
    public function attach($eventName, callable $listener, $priority = 0)
38
    {
39 19
        $this->eventManager->attach($eventName, $listener, $priority);
40 19
        return $this;
41
    }
42
}
43