1 | <?php |
||
8 | abstract class CrawlProfile |
||
9 | { |
||
10 | /** |
||
11 | * @var \Psr\Http\Message\UriInterface |
||
12 | */ |
||
13 | protected $baseUrl; |
||
14 | |||
15 | /** |
||
16 | * @param \Psr\Http\Message\UriInterface|string|null $baseUrl |
||
17 | */ |
||
18 | public function __construct($baseUrl = '') |
||
26 | |||
27 | /** |
||
28 | * Return url associated with the profile. |
||
29 | * |
||
30 | * @return \Psr\Http\Message\UriInterface |
||
31 | */ |
||
32 | public function getBaseUrl(): UriInterface |
||
36 | |||
37 | /** |
||
38 | * Determine if the given url should be crawled. |
||
39 | * |
||
40 | * @param \Psr\Http\Message\UriInterface $url |
||
41 | * |
||
42 | * @return bool |
||
43 | */ |
||
44 | abstract public function shouldCrawl(UriInterface $url): bool; |
||
45 | } |
||
46 |