From: Raphaël Gertz Date: Thu, 7 Mar 2024 21:40:57 +0000 (+0100) Subject: Force cast of simple xml element to string X-Git-Tag: 0.4.0~38 X-Git-Url: https://git.rapsys.eu/airbundle/commitdiff_plain/48b601a1a00dc70143e2b07c44d55597a426236e Force cast of simple xml element to string --- diff --git a/Command/WeatherCommand.php b/Command/WeatherCommand.php index c6fe6fc..b499390 100644 --- a/Command/WeatherCommand.php +++ b/Command/WeatherCommand.php @@ -265,7 +265,7 @@ class WeatherCommand extends DoctrineCommand { //Iterate on each link containing data foreach($sx->xpath('//a[contains(@class,"daily-forecast-card")]') as $node) { //Get date - $dsm = trim($node->div[0]->h2[0]->span[1]); + $dsm = trim((string)$node->div[0]->h2[0]->span[1]); //Get temperature $temperature = str_replace('°', '', (string)$node->div[0]->div[0]->span[0]);