Fixes in how METARs are parsed

This commit is contained in:
Nabeel Shahzad
2018-04-04 09:04:14 -05:00
parent 7a3a2f3e9a
commit 052813ba4a
4 changed files with 29 additions and 9 deletions

View File

@@ -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();
}
}