diff --git a/src/TypedClient.php b/src/TypedClient.php index d447957..5fe3e96 100644 --- a/src/TypedClient.php +++ b/src/TypedClient.php @@ -26,10 +26,6 @@ abstract public function _apiCall(string $method, array $parameters): string; */ private function _requestWithMap(string $method, array $requestParams, array $returnType) { - if (count($returnType) > 1) { - throw new TelegramException('More than one return type is not implemented'); - } - $responseJson = $this->_apiCall($method, $this->_prepareRequest($requestParams)); if (empty($returnType)) { try { @@ -39,7 +35,7 @@ private function _requestWithMap(string $method, array $requestParams, array $re } } - return Serializer::deserialize($responseJson, $returnType[0]); + return Serializer::deserialize($responseJson, implode('|', $returnType)); } /**