public function fetchUrl($url, $parameters = [], $json_formatted = true, $verb = 'get')
    {
        $full_url = $this->buildUrl($url, $parameters);

        $response = $this->client->{$verb}($full_url);

        return ($json_formatted) ? $response->json() : $response;
    }
public function fetchUrl($url, $parameters = [], $json_formatted = true, $verb = 'get')
    {
        $full_url = $this->buildUrl($url, $parameters);

        $response = $this->client->{$verb}($full_url);

        return ($json_formatted) ? $response->json() : $response;
    }
public function fetchUrl ( $ url , $ parameters = [ ] , $ json_formatted = true , $ verb = 'get' ) { $ full_url = $ this -> buildUrl ( $ url , $ parameters ) ; $ response = $ this -> client -> { $ verb } ( $ full_url ) ; return ( $ json_formatted ) ? $ response -> json ( ) : $ response ; }
build the URI from the provided data
do the actual call to the API through the Http Client
parse the data to return the shorten URL.

@param        $url            the url which needs to be Shortened
@param array  $parameters     parameters tp be added to the URL
@param bool   $json_formatted the format of the output
@param string $verb           the HTTP verb function in the Client

@return mixed
build the URI from the provided data do the actual call to the API through the Http Client parse the data to return the shorten URL .