src/Mremi/UrlShortener/Provider/Wechat/WechatProvider.php
public function shorten(LinkInterface $link)
    {
        $client = $this->createClient();

        $response = $client->post(sprintf('/cgi-bin/shorturl?access_token=%s',
            $this->auth->getAccessToken()
        ), array_merge(
            array(
                'json' => array(
                    'action'   => 'long2short',
                    'long_url' => $link->getLongUrl(),
                ),
            ),
            $this->options
        ));

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

        $link->setShortUrl($response->short_url);
    }
public function shorten(LinkInterface $link)
    {
        $client = $this->createClient();

        $response = $client->post(sprintf('/cgi-bin/shorturl?access_token=%s',
            $this->auth->getAccessToken()
        ), array_merge(
            array(
                'json' => array(
                    'action'   => 'long2short',
                    'long_url' => $link->getLongUrl(),
                ),
            ),
            $this->options
        ));

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

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

@param LinkInterface $link A link instance

@throws InvalidApiResponseException