private static function imageIsValid(Url $url, Url $baseUrl, $externalImages)
    {
        //base64 or same domain
        if ($url->getContent() !== null || $url->getDomain() === $baseUrl->getDomain()) {
            return true;
        }

        return is_bool($externalImages) ? $externalImages : $url->match($externalImages);
    }
private static function imageIsValid(Url $url, Url $baseUrl, $externalImages)
    {
        //base64 or same domain
        if ($url->getContent() !== null || $url->getDomain() === $baseUrl->getDomain()) {
            return true;
        }

        return is_bool($externalImages) ? $externalImages : $url->match($externalImages);
    }
private static function imageIsValid ( Url $ url , Url $ baseUrl , $ externalImages ) { //base64 or same domain if ( $ url -> getContent ( ) !== null || $ url -> getDomain ( ) === $ baseUrl -> getDomain ( ) ) { return true ; } return is_bool ( $ externalImages ) ? $ externalImages : $ url -> match ( $ externalImages ) ; }
Check whether a image url is valid or not.

@param Url   $url
@param Url   $baseUrl
@param mixed $externalImages

@return bool
Check whether a image url is valid or not .