]> Raphaƫl G. Git Repositories - airbundle/blobdiff - Command/WeatherCommand.php
Prevent fetching 4th day daily weather triggering a 404
[airbundle] / Command / WeatherCommand.php
index b499390e0912b2f135a08acdf07530b1bb75f588..0318383671451ebc6ad93e40dc6d19fc7937947d 100644 (file)
@@ -177,6 +177,12 @@ class WeatherCommand extends DoctrineCommand {
                                //Set stop day
                                $day = $stop->diff((new \DateTime('now'))->setTime(0, 0, 0))->d + 1;
 
+                               //Skip 4th day
+                               //XXX: accuweather only allow until 3rd day
+                               if ($day >= 4) {
+                                       continue;
+                               }
+
                                //Check if zipcode date is set
                                if (!isset($zipcodes[$zipcode][$day])) {
                                        $zipcodes[$zipcode][$day] = [ $sessionId => $sessionId ];