@@ -20,12 +20,23 @@ |
||
| 20 | 20 | file_put_contents($file, json_encode($data, JSON_PRETTY_PRINT).PHP_EOL); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @return string |
|
| 25 | + */ |
|
| 23 | 26 | protected function getHostsWithChecks() |
| 24 | 27 | { |
| 25 | 28 | $hosts = HostRepository::all(); |
| 26 | 29 | $result = $hosts->map( |
| 30 | + |
|
| 31 | + /** |
|
| 32 | + * @return string |
|
| 33 | + */ |
|
| 27 | 34 | function (Host $host) { |
| 28 | 35 | $checks = $host->checks->map( |
| 36 | + |
|
| 37 | + /** |
|
| 38 | + * @return string |
|
| 39 | + */ |
|
| 29 | 40 | function (Check $check) { |
| 30 | 41 | return $check->type; |
| 31 | 42 | } |
@@ -2,9 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Spatie\ServerMonitor\Commands; |
| 4 | 4 | |
| 5 | -use Spatie\ServerMonitor\Models\Host; |
|
| 6 | -use Spatie\ServerMonitor\Models\Check; |
|
| 7 | 5 | use Spatie\ServerMonitor\HostRepository; |
| 6 | +use Spatie\ServerMonitor\Models\Check; |
|
| 7 | +use Spatie\ServerMonitor\Models\Host; |
|
| 8 | 8 | |
| 9 | 9 | class DumpChecks extends BaseCommand |
| 10 | 10 | { |