Fix/metar reading (#353)
* Fix reading of the METAR information for AviationWeather. Fix the DI * StyleCI fixes
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Models\Acars;
|
||||
use App\Models\Airline;
|
||||
use App\Models\Pirep;
|
||||
use App\Models\User;
|
||||
use App\Services\AirportService;
|
||||
use App\Services\AwardService;
|
||||
use App\Services\DatabaseService;
|
||||
use Illuminate\Database\QueryException;
|
||||
@@ -55,6 +56,7 @@ class DevCommands extends Command
|
||||
'db-attrs' => 'dbAttrs',
|
||||
'list-awards' => 'listAwardClasses',
|
||||
'manual-insert' => 'manualInsert',
|
||||
'metar' => 'getMetar',
|
||||
'reset-install' => 'resetInstall',
|
||||
'xml-to-yaml' => 'xmlToYaml',
|
||||
];
|
||||
@@ -187,6 +189,19 @@ class DevCommands extends Command
|
||||
$this->info('Writing yaml to storage: '.$file_name);
|
||||
}
|
||||
|
||||
protected function getMetar(): void
|
||||
{
|
||||
$icao = $this->argument('param');
|
||||
if (!$icao) {
|
||||
$this->error('Enter an ICAO!');
|
||||
exit();
|
||||
}
|
||||
|
||||
$airportSvc = app(AirportService::class);
|
||||
$metar = $airportSvc->getMetar($icao);
|
||||
$this->info($metar->raw);
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert the rows from the file, manually advancing each row
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user