| Conditions | 5 |
| Paths | 16 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function handle() |
||
| 41 | { |
||
| 42 | $last_check = StatusCheckModel::latest()->first(); |
||
| 43 | if(!$last_check) $last_check_id = 0; |
||
| 44 | if($last_check) $last_check_id = $last_check->group_id + 1; |
||
| 45 | |||
| 46 | $status_check = []; |
||
| 47 | |||
| 48 | foreach(config('status-check.checks') AS $class) { |
||
| 49 | $check = new $class; |
||
| 50 | $status_check[$check->name] = $check->handle(); |
||
| 51 | } |
||
| 52 | |||
| 53 | foreach($status_check AS $name => $value) { |
||
| 54 | StatusCheckModel::create([ |
||
| 55 | 'group_id' => $last_check_id, |
||
| 56 | 'name' => $name, |
||
| 57 | 'results' => $value['results'], |
||
| 58 | 'status' => $value['status'], |
||
| 59 | ]); |
||
| 60 | } |
||
| 61 | } |
||
| 62 | } |
||
| 63 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.