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

MappedRegistry::find()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 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