Conditions | 5 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
39 | public function get($name) |
||
40 | { |
||
41 | if (array_key_exists($name, $this->mappers)) { |
||
42 | return $this->mappers[$name]; |
||
43 | } |
||
44 | |||
45 | if (array_key_exists($name, $this->description)) { |
||
46 | return $this->mappers[$name] = call_user_func($this->description[$name]); |
||
47 | } |
||
48 | |||
49 | foreach ($this->resolvers as $resolver) { |
||
50 | $mapper = call_user_func($resolver, $name); |
||
51 | if ($mapper) { |
||
52 | return $this->mappers[$name] = $mapper; |
||
53 | } |
||
54 | } |
||
55 | |||
56 | throw new Exception("Mapper $name is not registered"); |
||
57 | } |
||
58 | |||
64 |