Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3.0987 |
Changes | 0 |
1 | <?php |
||
30 | 4 | public function handler($result) |
|
31 | { |
||
32 | 4 | $this->result = $result; |
|
33 | 4 | if (is_string($result)) { |
|
34 | if (!method_exists($this->test, $result)) { |
||
35 | throw new Exception("Invalid method ".get_class($this->test)."::$result"); |
||
36 | } |
||
37 | 1 | $this->result = function($params) use ($result) { |
|
38 | 1 | $params = $this->converter->toObject($params); |
|
39 | 1 | return $this->test->$result($params); |
|
40 | }; |
||
41 | } |
||
42 | 4 | return $this; |
|
43 | } |
||
44 | |||
55 |