get('key')) { throw new GatewayErrorException("key not found", -2, []); } $params = [ 'mobile' => $to->getNumber(), 'content' => $message->getContent($this), 'userId' => $config->get('key'), 'password' => $config->get('secret'), 'apiType' => $config->get('api_type'), ]; $result = $this->get(self::ENDPOINT_URL, $params); $result = is_string($result) ? json_decode($result, true) : $result; if (self::SUCCESS_CODE != $result['code']) { throw new GatewayErrorException($result['msg'], $result['code'], $result); } return $result; } }