public function call(ApiCallInterface $call)
    {
        if ($call instanceof CurlCall) {
            if ($this->freshConnect || $this->engine === null || !($this->engine instanceof Curl)) {
                $this->engine = new Curl();
            }
        } else {
            if ($this->freshConnect || $this->engine === null || !($this->engine instanceof \SoapClient)) {
                $this->engine = new \SoapClient($call->getUrl());
            }
        }

        if ($this->logger) {
            $this->logger->startCall($call);
        }
        $this->lastCall = $call;
        $result = $call->execute($this->options, $this->engine, $this->freshConnect);
        if ($this->logger) {
            $this->logger->stopCall($call);
        }

        if ($call instanceof CurlCall) {
            if ($this->freshConnect) {
                $this->engine->close();
            }
        }

        return $result;
    }
public function call(ApiCallInterface $call)
    {
        if ($call instanceof CurlCall) {
            if ($this->freshConnect || $this->engine === null || !($this->engine instanceof Curl)) {
                $this->engine = new Curl();
            }
        } else {
            if ($this->freshConnect || $this->engine === null || !($this->engine instanceof \SoapClient)) {
                $this->engine = new \SoapClient($call->getUrl());
            }
        }

        if ($this->logger) {
            $this->logger->startCall($call);
        }
        $this->lastCall = $call;
        $result = $call->execute($this->options, $this->engine, $this->freshConnect);
        if ($this->logger) {
            $this->logger->stopCall($call);
        }

        if ($call instanceof CurlCall) {
            if ($this->freshConnect) {
                $this->engine->close();
            }
        }

        return $result;
    }
public function call ( ApiCallInterface $ call ) { if ( $ call instanceof CurlCall ) { if ( $ this -> freshConnect || $ this -> engine === null || ! ( $ this -> engine instanceof Curl ) ) { $ this -> engine = new Curl ( ) ; } } else { if ( $ this -> freshConnect || $ this -> engine === null || ! ( $ this -> engine instanceof \ SoapClient ) ) { $ this -> engine = new \ SoapClient ( $ call -> getUrl ( ) ) ; } } if ( $ this -> logger ) { $ this -> logger -> startCall ( $ call ) ; } $ this -> lastCall = $ call ; $ result = $ call -> execute ( $ this -> options , $ this -> engine , $ this -> freshConnect ) ; if ( $ this -> logger ) { $ this -> logger -> stopCall ( $ call ) ; } if ( $ call instanceof CurlCall ) { if ( $ this -> freshConnect ) { $ this -> engine -> close ( ) ; } } return $ result ; }
Execute an API call using a certain method

@param ApiCallInterface $call The API call

@return string The parsed response of the API call
Execute an API call using a certain method