Step::__invoke()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 2
dl 0
loc 10
ccs 6
cts 6
cp 1
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace einfach\operation\step;
4
5
use einfach\operation\Railway;
6
7
class Step extends AbstractStep
8
{
9 10
    public function __invoke(&$params, string $track)
10
    {
11
        // only on OK track
12 10
        if ($track == Railway::TRACK_SUCCESS) {
13 8
            $response = call_user_func($this->function, $params);
14 7
            return $this->normalizeStepResponse($response);
15
        } else {
16 2
            $this->skip();
17
        }
18 2
    }
19
}
20