1 | <?php |
||
13 | class ArrayCrawlQueue implements CrawlQueue |
||
14 | { |
||
15 | /** |
||
16 | * All known URLs, indexed by URL string. |
||
17 | * |
||
18 | * @var CrawlUrl[] |
||
19 | */ |
||
20 | protected $urls = []; |
||
21 | |||
22 | /** |
||
23 | * Pending URLs, indexed by URL string. |
||
24 | * |
||
25 | * @var CrawlUrl[] |
||
26 | */ |
||
27 | protected $pendingUrls = []; |
||
28 | |||
29 | public function add(CrawlUrl $url) : CrawlQueue |
||
42 | |||
43 | public function hasPendingUrls() : bool |
||
47 | |||
48 | public function getUrlById($id) : CrawlUrl |
||
56 | |||
57 | public function hasAlreadyBeenProcessed(CrawlUrl $url) : bool |
||
63 | |||
64 | public function markAsProcessed(CrawlUrl $crawlUrl) |
||
70 | |||
71 | /** |
||
72 | * @param CrawlUrl|UriInterface $crawlUrl |
||
73 | * |
||
74 | * @return bool |
||
75 | */ |
||
76 | public function has($crawlUrl) : bool |
||
93 | |||
94 | public function getFirstPendingUrl() : ?CrawlUrl |
||
102 | } |
||
103 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.