]> Raphaël G. Git Repositories - airbundle/commitdiff
Force cast of simple xml element to string
authorRaphaël Gertz <git@rapsys.eu>
Thu, 7 Mar 2024 21:40:57 +0000 (22:40 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Thu, 7 Mar 2024 21:40:57 +0000 (22:40 +0100)
Command/WeatherCommand.php

index c6fe6fcad4c9bd0761bc16d1f9fe21a66b8c1e34..b499390e0912b2f135a08acdf07530b1bb75f588 100644 (file)
@@ -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]);