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