Spatie\Crawler\CrawlUrl::create PHP Method

create() public static method

public static create ( Url $url, Url $foundOnUrl = null )
$url Url
$foundOnUrl Url
    public static function create(Url $url, Url $foundOnUrl = null)
    {
        return new static($url, $foundOnUrl);
    }

Usage Example

Example #1
0
 /**
  * @param CrawlUrl|Url $crawlUrl
  *
  * @return bool
  */
 public function has($crawlUrl) : bool
 {
     if ($crawlUrl instanceof Url) {
         $crawlUrl = CrawlUrl::create($crawlUrl);
     }
     if ($this->contains($this->pending, $crawlUrl)) {
         return true;
     }
     if ($this->contains($this->processed, $crawlUrl)) {
         return true;
     }
     return false;
 }
All Usage Examples Of Spatie\Crawler\CrawlUrl::create