Total Complexity | 2 |
Total Lines | 19 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | abstract class ActionCommand extends Command |
||
11 | { |
||
12 | protected function action(string $title, \Closure $task, $resultMessage = 'Finished') |
||
13 | { |
||
14 | /** @var float $actionTime */ |
||
15 | $actionTime = microtime(true); |
||
16 | |||
17 | $this->comment("$title..."); |
||
18 | |||
19 | $result = $task(); |
||
20 | |||
21 | $this->line(" > $resultMessage in ".$this->getExecutionTimeInMs($actionTime).'ms'); |
||
22 | |||
23 | return $result; |
||
24 | } |
||
25 | |||
26 | protected function getExecutionTimeInMs(float $timeStart): string |
||
29 | } |
||
30 | } |
||
31 |