コード例 #1
0
ファイル: SchemeLess.php プロジェクト: innmind/url-resolver
 /**
  * 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]*:?\\/\\//');
 }
コード例 #2
0
ファイル: RelativePath.php プロジェクト: innmind/url-resolver
 /**
  * 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('/^(\\/|\\?|#)/');
 }
コード例 #3
0
ファイル: Url.php プロジェクト: innmind/url-resolver
 /**
  * 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);
 }