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 \Psr\Log\LoggerInterface |
||
90 | */ |
||
91 | protected $logger; |
||
92 | |||
93 | /** |
||
94 | * @var array |
||
95 | */ |
||
96 | protected $standards; |
||
97 | |||
98 | /** |
||
99 | * @var \FeedIo\Reader\FixerSet |
||
100 | */ |
||
101 | protected $fixerSet; |
||
102 | 11 | ||
103 | /** |
||
104 | 11 | * @param \FeedIo\Adapter\ClientInterface $client |
|
105 | 11 | * @param \Psr\Log\LoggerInterface $logger |
|
106 | 11 | */ |
|
107 | 11 | public function __construct(ClientInterface $client, LoggerInterface $logger) |
|
115 | |||
116 | 11 | /** |
|
117 | * Loads main standards (RSS, RDF, Atom) in current object's attributes |
||
118 | 11 | * |
|
119 | 11 | * @return FeedIo |
|
120 | 11 | */ |
|
121 | 11 | protected function loadCommonStandards() : FeedIo |
|
130 | |||
131 | /** |
||
132 | 2 | * adds a filter to the reader |
|
133 | * |
||
134 | 2 | * @param \FeedIo\FilterInterface $filter |
|
135 | * @return FeedIo |
||
136 | 2 | */ |
|
137 | public function addFilter(FilterInterface $filter) : FeedIo |
||
143 | |||
144 | 11 | /** |
|
145 | * Returns main standards |
||
146 | 11 | * |
|
147 | * @return array |
||
148 | 11 | */ |
|
149 | public function getCommonStandards() : array |
||
155 | |||
156 | 11 | /** |
|
157 | * @param string $name |
||
158 | 11 | * @param \FeedIo\StandardAbstract $standard |
|
159 | 11 | * @return FeedIo |
|
160 | 11 | */ |
|
161 | 11 | public function addStandard(string $name, StandardAbstract $standard) : FeedIo |
|
170 | |||
171 | 10 | /** |
|
172 | * @param string $format |
||
173 | 10 | * @param StandardAbstract $standard |
|
174 | * @return ParserAbstract |
||
175 | 10 | */ |
|
176 | public function newParser(string $format, StandardAbstract $standard) : ParserAbstract |
||
186 | |||
187 | 1 | /** |
|
188 | * @return \FeedIo\Reader\FixerSet |
||
189 | */ |
||
190 | public function getFixerSet() : FixerSet |
||
194 | |||
195 | 10 | /** |
|
196 | 10 | * @return FeedIo |
|
197 | */ |
||
198 | 10 | protected function loadFixerSet() : FeedIo |
|
209 | 10 | ||
210 | /** |
||
211 | 10 | * @param FixerAbstract $fixer |
|
212 | 10 | * @return FeedIo |
|
213 | */ |
||
214 | 10 | public function addFixer(FixerAbstract $fixer) : FeedIo |
|
221 | |||
222 | /** |
||
223 | 10 | * @return array |
|
224 | 10 | */ |
|
225 | public function getBaseFixers() : array |
||
232 | |||
233 | 1 | /** |
|
234 | * @param array $formats |
||
235 | 1 | * @return FeedIo |
|
236 | 1 | */ |
|
237 | 1 | public function addDateFormats(array $formats) : FeedIo |
|
245 | 11 | ||
246 | /** |
||
247 | 11 | * @return \FeedIo\Rule\DateTimeBuilder |
|
248 | */ |
||
249 | public function getDateTimeBuilder() : DateTimeBuilder |
||
253 | 4 | ||
254 | /** |
||
255 | 4 | * @return \FeedIo\Reader |
|
256 | */ |
||
257 | public function getReader() : Reader |
||
261 | |||
262 | 11 | /** |
|
263 | * @param \FeedIo\Reader $reader |
||
264 | 11 | * @return FeedIo |
|
265 | */ |
||
266 | 11 | public function setReader(Reader $reader) : FeedIo |
|
272 | |||
273 | /** |
||
274 | * @param iterable $requests |
||
275 | 2 | * @param CallbackInterface $callback |
|
276 | * @param string $feedClass |
||
277 | 2 | */ |
|
278 | 1 | public function readAsync(iterable $requests, CallbackInterface $callback, string $feedClass = '\FeedIo\Feed') : void |
|
284 | |||
285 | 2 | /** |
|
286 | 2 | * @param string $url |
|
287 | * @param FeedInterface $feed |
||
288 | 2 | * @param \DateTime $modifiedSince |
|
289 | * @return \FeedIo\Reader\Result |
||
290 | 2 | */ |
|
291 | public function read(string $url, FeedInterface $feed = null, \DateTime $modifiedSince = null) : Result |
||
308 | 1 | ||
309 | /** |
||
310 | 1 | * @param string $url |
|
311 | * @param \DateTime $modifiedSince |
||
312 | * @return \FeedIo\Reader\Result |
||
313 | */ |
||
314 | public function readSince(string $url, \DateTime $modifiedSince) : Result |
||
318 | 1 | ||
319 | /** |
||
320 | 1 | * @return FeedIo |
|
321 | */ |
||
322 | 1 | public function resetFilters() : FeedIo |
|
328 | |||
329 | /** |
||
330 | * Get a PSR-7 compliant response for the given feed |
||
331 | 1 | * |
|
332 | * @param \FeedIo\FeedInterface $feed |
||
333 | 1 | * @param string $standard |
|
334 | * @param int $maxAge |
||
335 | * @param bool $public |
||
336 | * @return ResponseInterface |
||
337 | */ |
||
338 | public function getPsrResponse(FeedInterface $feed, string $standard, int $maxAge = 600, bool $public = true) : ResponseInterface |
||
347 | |||
348 | /** |
||
349 | 1 | * @param FeedInterface $feed |
|
350 | * @param string $standard Standard's name |
||
351 | 1 | * @return string |
|
352 | */ |
||
353 | public function format(FeedInterface $feed, string $standard) : string |
||
361 | |||
362 | 2 | /** |
|
363 | 2 | * @param \FeedIo\FeedInterface $feed |
|
364 | 1 | * @return string |
|
365 | */ |
||
366 | public function toRss(FeedInterface $feed) : string |
||
370 | |||
371 | /** |
||
372 | * @param \FeedIo\FeedInterface $feed |
||
373 | * @return string |
||
374 | */ |
||
375 | 2 | public function toAtom(FeedInterface $feed) : string |
|
379 | |||
380 | 2 | /** |
|
381 | * @param \FeedIo\FeedInterface $feed |
||
382 | * @return string |
||
383 | */ |
||
384 | public function toJson(FeedInterface $feed) : string |
||
388 | |||
389 | |||
390 | /** |
||
391 | * @param string $name |
||
392 | * @return \FeedIo\StandardAbstract |
||
393 | * @throws \OutOfBoundsException |
||
394 | */ |
||
395 | public function getStandard(string $name) : StandardAbstract |
||
404 | |||
405 | /** |
||
406 | * @param \FeedIo\FeedInterface $feed |
||
407 | * @param string $message |
||
408 | * @return FeedIo |
||
409 | */ |
||
410 | protected function logAction(FeedInterface $feed, string $message) : FeedIo |
||
417 | } |
||
418 |
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.