protected function fetchEndpointForUrl($url)
    {
        $client = new Client($url);

        $body = $client->send();

        $regexp = str_replace(
            '@formats@',
            implode('|', $this->supportedFormats),
            self::LINK_REGEXP
        );

        if (!preg_match_all($regexp, $body, $matches, PREG_SET_ORDER)) {
            throw new \InvalidArgumentException('No valid oEmbed links found on page.');
        }

        foreach ($matches as $match) {
            if ($match['Format'] === $this->preferredFormat) {
                return $this->extractEndpointFromAttributes($match['Attributes']);
            }
        }

        return $this->extractEndpointFromAttributes($match['Attributes']);
    }
protected function fetchEndpointForUrl($url)
    {
        $client = new Client($url);

        $body = $client->send();

        $regexp = str_replace(
            '@formats@',
            implode('|', $this->supportedFormats),
            self::LINK_REGEXP
        );

        if (!preg_match_all($regexp, $body, $matches, PREG_SET_ORDER)) {
            throw new \InvalidArgumentException('No valid oEmbed links found on page.');
        }

        foreach ($matches as $match) {
            if ($match['Format'] === $this->preferredFormat) {
                return $this->extractEndpointFromAttributes($match['Attributes']);
            }
        }

        return $this->extractEndpointFromAttributes($match['Attributes']);
    }
protected function fetchEndpointForUrl ( $ url ) { $ client = new Client ( $ url ) ; $ body = $ client -> send ( ) ; $ regexp = str_replace ( '@formats@' , implode ( '|' , $ this -> supportedFormats ) , self :: LINK_REGEXP ) ; if ( ! preg_match_all ( $ regexp , $ body , $ matches , PREG_SET_ORDER ) ) { throw new \ InvalidArgumentException ( 'No valid oEmbed links found on page.' ) ; } foreach ( $ matches as $ match ) { if ( $ match [ 'Format' ] === $ this -> preferredFormat ) { return $ this -> extractEndpointFromAttributes ( $ match [ 'Attributes' ] ) ; } } return $ this -> extractEndpointFromAttributes ( $ match [ 'Attributes' ] ) ; }
Fetch the provider's endpoint URL for the supplied resource

@param string $url The provider's endpoint URL for the supplied resource

@return string

@throws \InvalidArgumentException If no valid link was found
Fetch the provider s endpoint URL for the supplied resource