| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | public function __construct($callable, $args) |
||
| 13 | { |
||
| 14 | if (!is_array($args)) { |
||
| 15 | $args = [$args]; |
||
| 16 | } |
||
| 17 | try { |
||
| 18 | $this->result = call_user_func_array($callable, $args); |
||
| 19 | $this->isSuccess = true; |
||
| 20 | $this->isFailure = false; |
||
| 21 | } catch (\Exception $e) { |
||
| 22 | $this->result = $e; |
||
| 23 | $this->isSuccess = false; |
||
| 24 | $this->isFailure = true; |
||
| 25 | } |
||
| 26 | } |
||
| 27 | |||
| 58 |