/** * Check if the given url has a scheme or not * * @param UrlModel $url * * @return bool */ public function isSatisfiedBy(UrlModel $url) : bool { if ((string) $url->substring(0, 2) === '//') { return true; } return !$url->match('/^[a-zA-Z]*:?\\/\\//'); }
/** * Check if the given Url is a relative path * * @param UrlModel $url * * @return bool */ public function isSatisfiedBy(UrlModel $url) : bool { if ((string) $url->substring(0, 2) === './') { return true; } if ((string) $url->substring(0, 3) === '../') { return true; } return !$url->match('/^(\\/|\\?|#)/'); }
/** * Check if the given url is a valid url * * @param UrlModel $url * * @return bool */ public function isSatisfiedBy(UrlModel $url) : bool { return $url->match($this->regex); }
/** * Check if the given Url is simply a query string * * @param UrlModel $url * * @return bool */ public function isSatisfiedBy(UrlModel $url) : bool { return (string) $url->substring(0, 1) === '?'; }