Conditions | 3 |
Paths | 4 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | public function run() |
||
39 | { |
||
40 | $result = call_user_func($this->fn, $this->getState()); |
||
41 | // If the function returns no result, then count it |
||
42 | // as a success. |
||
43 | if (!isset($result)) { |
||
44 | $result = Result::success($this->reference); |
||
45 | } |
||
46 | // If the function returns a result, it must either return |
||
47 | // a \Robo\Result or an exit code. In the later case, we |
||
48 | // convert it to a \Robo\Result. |
||
49 | if (!$result instanceof Result) { |
||
50 | $result = new Result($this->reference, $result); |
||
51 | } |
||
52 | |||
53 | return $result; |
||
54 | } |
||
55 | |||
67 |