Conditions | 7 |
Paths | 9 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function shouldCrawl(UriInterface $url): bool |
||
26 | { |
||
27 | if (! parent::shouldCrawl($url)) { |
||
28 | return false; |
||
29 | } |
||
30 | |||
31 | if ((string) $url === (string) $this->baseUrl) { |
||
32 | return true; |
||
33 | } |
||
34 | |||
35 | foreach ($this->filters as $filter) { |
||
36 | if (! preg_match("/{$filter}/", (string) $url)) { |
||
37 | return false; |
||
38 | } |
||
39 | } |
||
40 | |||
41 | foreach ($this->ignores as $ignore) { |
||
42 | if (preg_match("/{$ignore}/", (string) $url)) { |
||
43 | return false; |
||
44 | } |
||
45 | } |
||
46 | |||
47 | return true; |
||
48 | } |
||
49 | } |
||
50 |