1 | <?php |
||
8 | class CollectionCrawlQueue implements CrawlQueue |
||
9 | { |
||
10 | /** @var \Illuminate\Support\Collection|\Tightenco\Collect\Support\Collection */ |
||
11 | protected $urls; |
||
12 | |||
13 | /** @var \Illuminate\Support\Collection|\Tightenco\Collect\Support\Collection */ |
||
14 | protected $pendingUrls; |
||
15 | |||
16 | public function __construct() |
||
22 | |||
23 | public function add(CrawlUrl $url): CrawlQueue |
||
36 | |||
37 | public function hasPendingUrls(): bool |
||
41 | |||
42 | /** |
||
43 | * @param mixed $id |
||
44 | * |
||
45 | * @return \Spatie\Crawler\CrawlUrl|null |
||
46 | */ |
||
47 | public function getUrlById($id): CrawlUrl |
||
55 | |||
56 | public function hasAlreadyBeenProcessed(CrawlUrl $url): bool |
||
60 | |||
61 | public function markAsProcessed(CrawlUrl $crawlUrl) |
||
68 | |||
69 | /** |
||
70 | * @param CrawlUrl|\Psr\Http\Message\UriInterface|string $crawlUrl |
||
71 | * |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function has($crawlUrl): bool |
||
86 | |||
87 | /** @return \Spatie\Crawler\CrawlUrl|null */ |
||
88 | public function getFirstPendingUrl() |
||
92 | |||
93 | public function count(): int |
||
97 | |||
98 | /** |
||
99 | * @param \Illuminate\Support\Collection|\Tightenco\Collect\Support\Collection $collection |
||
100 | * @param \Spatie\Crawler\CrawlUrl $searchCrawlUrl |
||
101 | * |
||
102 | * @return bool |
||
103 | */ |
||
104 | protected function contains($collection, CrawlUrl $searchCrawlUrl): bool |
||
114 | } |
||
115 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.