Completed
Push — master ( 5cbf4f...a11706 )
by Andrew
02:23
created

MappedRegistry   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 4 1
A find() 0 6 1
1
<?php namespace Cairns\Radiate\Registry;
2
3
final class MappedRegistry implements Registry
4
{
5
    private $listeners;
6
7
    public function register($event, $listener)
8
    {
9
        $this->listeners[$event][] = $listener;
10
    }
11
12
    public function find($event)
13
    {
14
        $eventClassName = get_class($event);
15
16
        return $this->listeners[$eventClassName];
17
    }
18
}
19