From bd4d68bcbff8877d4f47e7b008aa653cddcf3894 Mon Sep 17 00:00:00 2001 From: Collapsed Plug Date: Tue, 17 Apr 2018 23:02:00 +0900 Subject: [PATCH 1/2] Removed not-so-forecast measure Because it won't happen again --- Cmfcmf/OpenWeatherMap/WeatherForecast.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Cmfcmf/OpenWeatherMap/WeatherForecast.php b/Cmfcmf/OpenWeatherMap/WeatherForecast.php index 2fc6a6c..9264ea9 100644 --- a/Cmfcmf/OpenWeatherMap/WeatherForecast.php +++ b/Cmfcmf/OpenWeatherMap/WeatherForecast.php @@ -78,16 +78,8 @@ public function __construct($xml, $units, $days) $this->sun = new Sun(new \DateTime($xml->sun['rise'], $utctz), new \DateTime($xml->sun['set'], $utctz)); $this->lastUpdate = new \DateTime($xml->meta->lastupdate, $utctz); - $today = new \DateTime('now', $utctz); - $today->setTime(0, 0, 0); $counter = 0; foreach ($xml->forecast->time as $time) { - $date = new \DateTime(isset($time['day']) ? $time['day'] : $time['to'], $utctz); - if ($date < $today) { - // Sometimes OpenWeatherMap returns results which aren't real - // forecasts. The best we can do is to ignore them. - continue; - } $forecast = new Forecast($time, $units); $forecast->city = $this->city; $forecast->sun = $this->sun; From 3f1e34d39ade4278efdc33e4b4f20710e20f545a Mon Sep 17 00:00:00 2001 From: Christian Flach Date: Wed, 9 May 2018 10:41:44 +0200 Subject: [PATCH 2/2] Remove not-so-forecast tests --- tests/FakeData.php | 4 ++-- tests/OpenWeatherMap/WeatherForecastTest.php | 11 ++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/tests/FakeData.php b/tests/FakeData.php index c6bd1d1..2890b39 100644 --- a/tests/FakeData.php +++ b/tests/FakeData.php @@ -65,7 +65,7 @@ public static function forecastXML() -