public function performApiRequest(TelegramMethods $method): PromiseInterface
    {
        $this->logger->debug('Request for async API call, resetting internal values', [\get_class($method)]);
        $this->resetObjectValues();
        $option = $this->formConstructor->constructOptions($method);
        return $this->sendRequestToTelegram($method, $option)
            ->then(function (TelegramResponse $response) use ($method) {
                return $method::bindToObject($response, $this->logger);
            }, function ($error) {
                $this->logger->error($error);
                throw $error;
            });
    }
public function performApiRequest(TelegramMethods $method): PromiseInterface
    {
        $this->logger->debug('Request for async API call, resetting internal values', [\get_class($method)]);
        $this->resetObjectValues();
        $option = $this->formConstructor->constructOptions($method);
        return $this->sendRequestToTelegram($method, $option)
            ->then(function (TelegramResponse $response) use ($method) {
                return $method::bindToObject($response, $this->logger);
            }, function ($error) {
                $this->logger->error($error);
                throw $error;
            });
    }
public function performApiRequest ( TelegramMethods $ method ) : PromiseInterface { $ this -> logger -> debug ( 'Request for async API call, resetting internal values' , [ \ get_class ( $ method ) ] ) ; $ this -> resetObjectValues ( ) ; $ option = $ this -> formConstructor -> constructOptions ( $ method ) ; return $ this -> sendRequestToTelegram ( $ method , $ option ) -> then ( function ( TelegramResponse $ response ) use ( $ method ) { return $ method :: bindToObject ( $ response , $ this -> logger ) ; } , function ( $ error ) { $ this -> logger -> error ( $ error ) ; throw $ error ; } ) ; }
Performs the request to the Telegram servers

@param TelegramMethods $method

@return PromiseInterface
@throws \unreal4u\TelegramAPI\Exceptions\MissingMandatoryField
Performs the request to the Telegram servers