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 getUrls() |
||
27 | |||
28 | public function getPendingUrls() |
||
32 | |||
33 | public function add(CrawlUrl $url): CrawlQueue |
||
46 | |||
47 | public function hasPendingUrls(): bool |
||
51 | |||
52 | /** |
||
53 | * @param mixed $id |
||
54 | * |
||
55 | * @return \Spatie\Crawler\CrawlUrl|null |
||
56 | */ |
||
57 | public function getUrlById($id): CrawlUrl |
||
65 | |||
66 | public function hasAlreadyBeenProcessed(CrawlUrl $url): bool |
||
70 | |||
71 | public function markAsProcessed(CrawlUrl $crawlUrl) |
||
78 | |||
79 | /** |
||
80 | * @param CrawlUrl|\Psr\Http\Message\UriInterface|string $crawlUrl |
||
81 | * |
||
82 | * @return bool |
||
83 | */ |
||
84 | public function has($crawlUrl): bool |
||
96 | |||
97 | /** @return \Spatie\Crawler\CrawlUrl|null */ |
||
98 | public function getFirstPendingUrl() |
||
102 | |||
103 | /** |
||
104 | * @param \Illuminate\Support\Collection|\Tightenco\Collect\Support\Collection $collection |
||
105 | * @param \Spatie\Crawler\CrawlUrl $searchCrawlUrl |
||
106 | * |
||
107 | * @return bool |
||
108 | */ |
||
109 | protected function contains($collection, CrawlUrl $searchCrawlUrl): bool |
||
119 | } |
||
120 |
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.