1 | <?php declare(strict_types=1); |
||
75 | class FeedIo |
||
76 | { |
||
77 | |||
78 | /** |
||
79 | * @var \FeedIo\Reader |
||
80 | */ |
||
81 | protected $reader; |
||
82 | |||
83 | /** |
||
84 | * @var \FeedIo\Rule\DateTimeBuilder |
||
85 | */ |
||
86 | protected $dateTimeBuilder; |
||
87 | |||
88 | /** |
||
89 | * @var \FeedIo\Adapter\ClientInterface; |
||
90 | */ |
||
91 | protected $client; |
||
92 | |||
93 | /** |
||
94 | * @var \Psr\Log\LoggerInterface |
||
95 | */ |
||
96 | protected $logger; |
||
97 | |||
98 | /** |
||
99 | * @var array |
||
100 | */ |
||
101 | protected $standards; |
||
102 | |||
103 | /** |
||
104 | * @var \FeedIo\Reader\FixerSet |
||
105 | */ |
||
106 | protected $fixerSet; |
||
107 | |||
108 | /** |
||
109 | * @param \FeedIo\Adapter\ClientInterface $client |
||
110 | * @param \Psr\Log\LoggerInterface $logger |
||
111 | */ |
||
112 | 13 | public function __construct(ClientInterface $client, LoggerInterface $logger) |
|
121 | |||
122 | /** |
||
123 | * Loads main standards (RSS, RDF, Atom) in current object's attributes |
||
124 | * |
||
125 | * @return FeedIo |
||
126 | */ |
||
127 | 13 | protected function loadCommonStandards() : FeedIo |
|
136 | |||
137 | /** |
||
138 | * adds a filter to the reader |
||
139 | * |
||
140 | * @param \FeedIo\FilterInterface $filter |
||
141 | * @return FeedIo |
||
142 | */ |
||
143 | 2 | public function addFilter(FilterInterface $filter) : FeedIo |
|
149 | |||
150 | /** |
||
151 | * Returns main standards |
||
152 | * |
||
153 | * @return array |
||
154 | */ |
||
155 | 13 | public function getCommonStandards() : array |
|
161 | |||
162 | /** |
||
163 | * @param string $name |
||
164 | * @param \FeedIo\StandardAbstract $standard |
||
165 | * @return FeedIo |
||
166 | */ |
||
167 | 13 | public function addStandard(string $name, StandardAbstract $standard) : FeedIo |
|
176 | |||
177 | /** |
||
178 | * @param string $format |
||
179 | * @param StandardAbstract $standard |
||
180 | * @return ParserAbstract |
||
181 | */ |
||
182 | 12 | public function newParser(string $format, StandardAbstract $standard) : ParserAbstract |
|
192 | |||
193 | /** |
||
194 | * @return \FeedIo\Reader\FixerSet |
||
195 | */ |
||
196 | 1 | public function getFixerSet() : FixerSet |
|
200 | |||
201 | /** |
||
202 | * @return FeedIo |
||
203 | */ |
||
204 | 12 | protected function loadFixerSet() : FeedIo |
|
215 | |||
216 | /** |
||
217 | * @param FixerAbstract $fixer |
||
218 | * @return FeedIo |
||
219 | */ |
||
220 | 12 | public function addFixer(FixerAbstract $fixer) : FeedIo |
|
227 | |||
228 | /** |
||
229 | * @return array |
||
230 | */ |
||
231 | 12 | public function getBaseFixers() : array |
|
238 | |||
239 | /** |
||
240 | * @param array $formats |
||
241 | * @return FeedIo |
||
242 | */ |
||
243 | 1 | public function addDateFormats(array $formats) : FeedIo |
|
251 | |||
252 | /** |
||
253 | * @return \FeedIo\Rule\DateTimeBuilder |
||
254 | */ |
||
255 | 13 | public function getDateTimeBuilder() : DateTimeBuilder |
|
259 | |||
260 | /** |
||
261 | * @return \FeedIo\Reader |
||
262 | */ |
||
263 | 4 | public function getReader() : Reader |
|
267 | |||
268 | /** |
||
269 | * @param \FeedIo\Reader $reader |
||
270 | * @return FeedIo |
||
271 | */ |
||
272 | 13 | public function setReader(Reader $reader) : FeedIo |
|
278 | |||
279 | /** |
||
280 | * Discover feeds from the webpage's headers |
||
281 | * @param string $url |
||
282 | * @return array |
||
283 | */ |
||
284 | 1 | public function discover(string $url) : array |
|
290 | |||
291 | /** |
||
292 | * @param iterable $requests |
||
293 | * @param CallbackInterface $callback |
||
294 | * @param string $feedClass |
||
295 | */ |
||
296 | public function readAsync(iterable $requests, CallbackInterface $callback, string $feedClass = '\FeedIo\Feed') : void |
||
302 | |||
303 | /** |
||
304 | * @param string $url |
||
305 | * @param FeedInterface $feed |
||
306 | * @param \DateTime $modifiedSince |
||
307 | * @return \FeedIo\Reader\Result |
||
308 | */ |
||
309 | 2 | public function read(string $url, FeedInterface $feed = null, \DateTime $modifiedSince = null) : Result |
|
326 | |||
327 | /** |
||
328 | * @param string $url |
||
329 | * @param \DateTime $modifiedSince |
||
330 | * @return \FeedIo\Reader\Result |
||
331 | */ |
||
332 | 1 | public function readSince(string $url, \DateTime $modifiedSince) : Result |
|
336 | |||
337 | /** |
||
338 | * @return FeedIo |
||
339 | */ |
||
340 | 1 | public function resetFilters() : FeedIo |
|
346 | |||
347 | /** |
||
348 | * Get a PSR-7 compliant response for the given feed |
||
349 | * |
||
350 | * @param \FeedIo\FeedInterface $feed |
||
351 | * @param string $standard |
||
352 | * @param int $maxAge |
||
353 | * @param bool $public |
||
354 | * @return ResponseInterface |
||
355 | */ |
||
356 | 1 | public function getPsrResponse(FeedInterface $feed, string $standard, int $maxAge = 600, bool $public = true) : ResponseInterface |
|
365 | |||
366 | /** |
||
367 | * @param FeedInterface $feed |
||
368 | * @param string $standard Standard's name |
||
369 | * @return string |
||
370 | */ |
||
371 | 1 | public function format(FeedInterface $feed, string $standard) : string |
|
379 | |||
380 | /** |
||
381 | * @param \FeedIo\FeedInterface $feed |
||
382 | * @return string |
||
383 | */ |
||
384 | 1 | public function toRss(FeedInterface $feed) : string |
|
388 | |||
389 | /** |
||
390 | * @param \FeedIo\FeedInterface $feed |
||
391 | * @return string |
||
392 | */ |
||
393 | 1 | public function toAtom(FeedInterface $feed) : string |
|
397 | |||
398 | /** |
||
399 | * @param \FeedIo\FeedInterface $feed |
||
400 | * @return string |
||
401 | */ |
||
402 | 1 | public function toJson(FeedInterface $feed) : string |
|
406 | |||
407 | |||
408 | /** |
||
409 | * @param string $name |
||
410 | * @return \FeedIo\StandardAbstract |
||
411 | * @throws \OutOfBoundsException |
||
412 | */ |
||
413 | 3 | public function getStandard(string $name) : StandardAbstract |
|
422 | |||
423 | /** |
||
424 | * @param \FeedIo\FeedInterface $feed |
||
425 | * @param string $message |
||
426 | * @return FeedIo |
||
427 | */ |
||
428 | 3 | protected function logAction(FeedInterface $feed, string $message) : FeedIo |
|
435 | } |
||
436 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.