| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 38 | public function log($command_name) |
||
| 39 | { |
||
| 40 | $log = Schedulelog::where('end', null)->latest('id', 'DESC')->first(); |
||
| 41 | |||
| 42 | if (count($log) == 0) { |
||
| 43 | return Schedulelog::create([ |
||
| 44 | 'command_name' => $command_name, |
||
| 45 | 'start' => microtime(true), |
||
| 46 | ]); |
||
| 47 | } else { |
||
| 48 | $log->end = microtime(true); |
||
| 49 | $log->save(); |
||
| 50 | |||
| 51 | return $log; |
||
| 52 | } |
||
| 53 | } |
||
| 54 | |||
| 67 |