1 | <?php |
||
19 | class Downloader implements DownloaderInterface |
||
20 | { |
||
21 | /** @var EventDispatcherInterface */ |
||
22 | private $dispatcher; |
||
23 | |||
24 | /** @var PersistenceHandlerInterface */ |
||
25 | private $persistenceHandler; |
||
26 | |||
27 | /** @var RequestHandlerInterface */ |
||
28 | private $requestHandler; |
||
29 | |||
30 | /** @var int the maximum number of downloaded resources. 0 means no limit */ |
||
31 | public $downloadLimit = 0; |
||
32 | |||
33 | /** @var PostFetchFilterInterface[] */ |
||
34 | private $postFetchFilters = array(); |
||
35 | |||
36 | /** |
||
37 | * @param PostFetchFilterInterface $filter |
||
38 | */ |
||
39 | public function addPostFetchFilter(PostFetchFilterInterface $filter) |
||
43 | |||
44 | /** |
||
45 | * @return false|Resource |
||
46 | */ |
||
47 | public function download(DiscoveredUri $uri) |
||
58 | |||
59 | public function isDownLoadLimitExceeded() |
||
63 | |||
64 | /** |
||
65 | * A shortcut for EventDispatcher::dispatch() |
||
66 | * |
||
67 | * @param string $eventName |
||
68 | * @param null|Event $event |
||
69 | */ |
||
70 | private function dispatch($eventName, Event $event = null) |
||
74 | |||
75 | /** |
||
76 | * @param EventDispatcherInterface $eventDispatcher |
||
77 | * @return $this |
||
78 | */ |
||
79 | public function setDispatcher(EventDispatcherInterface $eventDispatcher) |
||
85 | |||
86 | /** |
||
87 | * @return EventDispatcherInterface |
||
88 | */ |
||
89 | public function getDispatcher() |
||
96 | |||
97 | |||
98 | /** |
||
99 | * @param UriInterface $uri |
||
|
|||
100 | * @return Resource|false |
||
101 | */ |
||
102 | protected function fetchResource(DiscoveredUri $uri) |
||
127 | |||
128 | /** |
||
129 | * @param Resource $resource |
||
130 | * @return bool |
||
131 | */ |
||
132 | private function matchesPostfetchFilter(Resource $resource) |
||
145 | |||
146 | /** |
||
147 | * @param PersistenceHandlerInterface $persistenceHandler |
||
148 | */ |
||
149 | public function setPersistenceHandler(PersistenceHandlerInterface $persistenceHandler) |
||
153 | |||
154 | /** |
||
155 | * @return PersistenceHandlerInterface |
||
156 | */ |
||
157 | public function getPersistenceHandler() |
||
165 | |||
166 | /** |
||
167 | * @param RequestHandlerInterface $requestHandler |
||
168 | */ |
||
169 | public function setRequestHandler(RequestHandlerInterface $requestHandler) |
||
173 | |||
174 | /** |
||
175 | * @return RequestHandlerInterface |
||
176 | */ |
||
177 | public function getRequestHandler() |
||
185 | |||
186 | } |
||
187 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.