src/ImboClient/ImboClient.php
public function addImageFromUrl($url) {
        if (is_string($url)) {
            // URL specified as a string. Create a URL instance
            $url = GuzzleUrl::factory($url);
        }

        if (!($url instanceof GuzzleUrl)) {
            // Invalid argument
            throw new InvalidArgumentException(
                'Parameter must be a string or an instance of Guzzle\Http\Url'
            );
        }

        if (!$url->getScheme()) {
            throw new InvalidArgumentException('URL is missing scheme: ' . (string) $url);
        }

        // Fetch the image we want to add
        $image = (string) $this->get($url)->send()->getBody();

        return $this->addImageFromString($image);
    }
public function addImageFromUrl($url) {
        if (is_string($url)) {
            // URL specified as a string. Create a URL instance
            $url = GuzzleUrl::factory($url);
        }

        if (!($url instanceof GuzzleUrl)) {
            // Invalid argument
            throw new InvalidArgumentException(
                'Parameter must be a string or an instance of Guzzle\Http\Url'
            );
        }

        if (!$url->getScheme()) {
            throw new InvalidArgumentException('URL is missing scheme: ' . (string) $url);
        }

        // Fetch the image we want to add
        $image = (string) $this->get($url)->send()->getBody();

        return $this->addImageFromString($image);
    }
public function addImageFromUrl ( $ url ) { if ( is_string ( $ url ) ) { // URL specified as a string. Create a URL instance $ url = GuzzleUrl :: factory ( $ url ) ; } if ( ! ( $ url instanceof GuzzleUrl ) ) { // Invalid argument throw new InvalidArgumentException ( 'Parameter must be a string or an instance of Guzzle\Http\Url' ) ; } if ( ! $ url -> getScheme ( ) ) { throw new InvalidArgumentException ( 'URL is missing scheme: ' . ( string ) $ url ) ; } // Fetch the image we want to add $ image = ( string ) $ this -> get ( $ url ) -> send ( ) -> getBody ( ) ; return $ this -> addImageFromString ( $ image ) ; }
Add an image from a URL

@param GuzzleUrl|string $url A URL to an image
@return Model
@throws InvalidArgumentException
Add an image from a URL