src/Mremi/UrlShortener/Provider/Bitly/BitlyProvider.php
public function shorten(LinkInterface $link, $domain = null)
    {
        $client = $this->createClient();

        $response = $client->get(sprintf('/v3/shorten?access_token=%s&longUrl=%s&domain=%s',
            $this->auth->getAccessToken(),
            urlencode($link->getLongUrl()),
            $domain
        ), $this->options);

        $response = $this->validate($response->getBody()->getContents());

        $link->setShortUrl($response->data->url);
    }
public function shorten(LinkInterface $link, $domain = null)
    {
        $client = $this->createClient();

        $response = $client->get(sprintf('/v3/shorten?access_token=%s&longUrl=%s&domain=%s',
            $this->auth->getAccessToken(),
            urlencode($link->getLongUrl()),
            $domain
        ), $this->options);

        $response = $this->validate($response->getBody()->getContents());

        $link->setShortUrl($response->data->url);
    }
{@inheritdoc}

@param LinkInterface $link   A link instance
@param string        $domain The domain to use, optional (bit.ly | j.mp | bitly.com)

@throws InvalidApiResponseException