| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | 6 | public function __invoke(&$params, string $track) |
|
| 11 | { |
||
| 12 | // only on OK track |
||
| 13 | 6 | if ($track == Railway::TRACK_SUCCESS) { |
|
| 14 | try { |
||
| 15 | 4 | $response = $this->normalizeStepResponse(call_user_func($this->function, $params)); |
|
| 16 | 2 | return $response; |
|
| 17 | 2 | } catch (\Exception $e) { |
|
| 18 | 2 | return $this->normalizeStepResponse(error($params, $e->getMessage())); |
|
| 19 | } |
||
| 20 | } else { |
||
| 21 | 2 | $this->skip(); |
|
| 22 | } |
||
| 23 | 2 | } |
|
| 24 | } |
||
| 25 |