1 | <?php |
||
8 | class CollectionCrawlQueue implements CrawlQueue |
||
9 | { |
||
10 | /** @var \Illuminate\Support\Collection */ |
||
11 | public $urls; |
||
12 | |||
13 | /** @var \Illuminate\Support\Collection */ |
||
14 | public $pendingUrls; |
||
15 | |||
16 | public function __construct() |
||
22 | |||
23 | public function add(CrawlUrl $url): CrawlQueue |
||
36 | |||
37 | public function hasPendingUrls(): bool |
||
41 | |||
42 | /** |
||
43 | * @param int $id |
||
44 | * |
||
45 | * @return \Spatie\Crawler\CrawlUrl|null |
||
46 | */ |
||
47 | public function getUrlById(int $id): CrawlUrl |
||
55 | |||
56 | public function hasAlreadyBeenProcessed(CrawlUrl $url) |
||
60 | |||
61 | public function markAsProcessed(CrawlUrl $crawlUrl) |
||
68 | |||
69 | /** |
||
70 | * @param CrawlUrl|Url $crawlUrl |
||
71 | * |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function has($crawlUrl): bool |
||
86 | |||
87 | private function contains(Collection $collection, CrawlUrl $searchCrawlUrl): bool |
||
97 | |||
98 | /** @return \Spatie\Crawler\CrawlUrl|null */ |
||
99 | public function getFirstPendingUrl() |
||
103 | } |
||
104 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: