1 | <?php |
||
9 | abstract class AbstractStep |
||
10 | { |
||
11 | /** |
||
12 | * @var callable |
||
13 | */ |
||
14 | public $function; |
||
15 | protected $name; |
||
16 | /** |
||
17 | * Indicates was this step performed or not |
||
18 | * |
||
19 | * @var bool |
||
20 | */ |
||
21 | protected $skipped; |
||
22 | |||
23 | 8 | public function __construct(callable $callable, string $name = null) |
|
29 | |||
30 | 6 | public function isSkipped() : bool |
|
34 | |||
35 | 3 | public function skip() : bool |
|
39 | |||
40 | 3 | public function functionSignature() : string |
|
45 | |||
46 | /** |
||
47 | * Step name, respecting custom name |
||
48 | */ |
||
49 | 3 | public function name() : string |
|
53 | |||
54 | 1 | public function signature($template = "%-10s | %s") : string |
|
59 | |||
60 | /** |
||
61 | * Transform all results into valid resut array form |
||
62 | * It could be Result object instance for nested steps |
||
63 | */ |
||
64 | 3 | protected function normalizeStepResult($result) : array |
|
84 | |||
85 | abstract public function __invoke(&$params, string $track); |
||
86 | } |
||
87 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.