Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 5 |
Lines | 8 |
Ratio | 100 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
11 | 6 | public function __invoke(&$params, string $track) |
|
12 | { |
||
13 | 6 | $response = $this->normalizeStepResponse(call_user_func($this->function, $params)); |
|
14 | // run on any track, but not change it to OK, if strated on Error |
||
15 | 6 | $type = ($track == Railway::TRACK_FAILURE) ? RESPONSE_TYPE_ERROR : $response['type']; |
|
16 | 6 | $response['type'] = $type; |
|
17 | 6 | return $response; |
|
18 | } |
||
19 | } |
||
20 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.