Fixes in how METARs are parsed
This commit is contained in:
@@ -20,12 +20,13 @@ class AviationWeather extends Metar
|
||||
* Implement the METAR - Return the string
|
||||
* @param $icao
|
||||
* @return string
|
||||
* @throws \GuzzleHttp\Exception\GuzzleException
|
||||
*/
|
||||
protected function metar($icao): string
|
||||
{
|
||||
$url = static::METAR_URL.$icao;
|
||||
$res = Http::get($url, []);
|
||||
$xml = simplexml_load_string($res);
|
||||
return $xml->data->METAR->raw_text;
|
||||
return $xml->data->METAR->raw_text->__toString();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user