diff --git a/src/Authentication/Native.php b/src/Authentication/Native.php index f32e6b9..b41e306 100644 --- a/src/Authentication/Native.php +++ b/src/Authentication/Native.php @@ -125,12 +125,10 @@ private function settingsRules(array $params): V case 'icloud': case 'hotmail': return $this->knownProviderRule(); - case 'imap': return $this->imapProviderRule(); - case 'gmail': return $this->gmailProviderRule(); - case 'exchange': return $this->exchangeProviderRule(); + case 'imap': default: return $this->imapProviderRule(); } } diff --git a/src/Request/AbsBase.php b/src/Request/AbsBase.php index 6a2102f..ec3bdf2 100644 --- a/src/Request/AbsBase.php +++ b/src/Request/AbsBase.php @@ -12,7 +12,7 @@ * ---------------------------------------------------------------------------------- * * @author lanlin - * @change 2020/06/28 + * @change 2020/09/21 */ trait AbsBase { @@ -102,6 +102,8 @@ public function setBody($body) : self */ public function setQuery(array $query) : self { + $query = Helper::boolToString($query); + $this->queryParams = ['query' => $query]; return $this; diff --git a/src/Utilities/Helper.php b/src/Utilities/Helper.php index 8d605d6..9a9bd7d 100644 --- a/src/Utilities/Helper.php +++ b/src/Utilities/Helper.php @@ -10,7 +10,7 @@ * ---------------------------------------------------------------------------------- * * @author lanlin - * @change 2020/04/26 + * @change 2020/09/21 */ class Helper { @@ -110,6 +110,28 @@ public static function fooToArray($foo): array // ------------------------------------------------------------------------------ + /** + * convert boolean to string value + * + * @param array $data + * + * @return array + */ + public static function boolToString(array $data): array + { + foreach ($data as $key => $val) + { + if (\is_bool($val)) + { + $data[$key] = $val ? 'true' : 'false'; + } + } + + return $data; + } + + // ------------------------------------------------------------------------------ + /** * pickup element from inside array *