public function getLongLinkbyShort($shortLink)
    {
        $this->client->setMethod('GET');
        $this->client->setUri("https://www.googleapis.com/urlshortener/v1/url?shortUrl={$shortLink}");
        $contentJson = $this->client->send()->getContent();
        $responseArray = json_decode($contentJson, true);
        if (!empty($responseArray['error'])) {
            $response = new Response();
            return $response->setError($responseArray['error']['errors']);
        } else {
            $response = new Response();
            $response->setId($responseArray['id'])
                ->setKind($responseArray['kind'])
                ->setLongUrl($responseArray['longUrl'])
                ->setStatus($responseArray['status']);
            return $response;
        }
    }
public function getLongLinkbyShort($shortLink)
    {
        $this->client->setMethod('GET');
        $this->client->setUri("https://www.googleapis.com/urlshortener/v1/url?shortUrl={$shortLink}");
        $contentJson = $this->client->send()->getContent();
        $responseArray = json_decode($contentJson, true);
        if (!empty($responseArray['error'])) {
            $response = new Response();
            return $response->setError($responseArray['error']['errors']);
        } else {
            $response = new Response();
            $response->setId($responseArray['id'])
                ->setKind($responseArray['kind'])
                ->setLongUrl($responseArray['longUrl'])
                ->setStatus($responseArray['status']);
            return $response;
        }
    }
public function getLongLinkbyShort ( $ shortLink ) { $ this -> client -> setMethod ( 'GET' ) ; $ this -> client -> setUri ( "https://www.googleapis.com/urlshortener/v1/url?shortUrl={$shortLink}" ) ; $ contentJson = $ this -> client -> send ( ) -> getContent ( ) ; $ responseArray = json_decode ( $ contentJson , true ) ; if ( ! empty ( $ responseArray [ 'error' ] ) ) { $ response = new Response ( ) ; return $ response -> setError ( $ responseArray [ 'error' ] [ 'errors' ] ) ; } else { $ response = new Response ( ) ; $ response -> setId ( $ responseArray [ 'id' ] ) -> setKind ( $ responseArray [ 'kind' ] ) -> setLongUrl ( $ responseArray [ 'longUrl' ] ) -> setStatus ( $ responseArray [ 'status' ] ) ; return $ response ; } }
Return Long url bu Short url
@param $shortLink
@return Response
Return Long url bu Short url