From c942359d073d6922c6696d761097fc76613f5b8c Mon Sep 17 00:00:00 2001 From: overtrue Date: Fri, 21 Sep 2018 17:46:11 +0800 Subject: [PATCH] Bugfix. --- src/Weather.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Weather.php b/src/Weather.php index e3639f9..7f32a72 100644 --- a/src/Weather.php +++ b/src/Weather.php @@ -106,11 +106,14 @@ public function getWeather($city, $type = 'base', $format = 'json') throw new InvalidArgumentException('Invalid type value(base/all): '.$type); } + $format = \strtolower($format); + $type = \strtolower($type); + $query = array_filter([ 'key' => $this->key, 'city' => $city, - 'output' => \strtolower($format), - 'extensions' => \strtolower($type), + 'output' => $format, + 'extensions' => $type, ]); try {