1 | <?php declare(strict_types=1); |
||
76 | class FeedIo |
||
77 | { |
||
78 | |||
79 | /** |
||
80 | * @var \FeedIo\Reader |
||
81 | */ |
||
82 | protected $reader; |
||
83 | |||
84 | /** |
||
85 | * @var \FeedIo\Rule\DateTimeBuilder |
||
86 | */ |
||
87 | protected $dateTimeBuilder; |
||
88 | |||
89 | /** |
||
90 | * @var \FeedIo\Adapter\ClientInterface; |
||
91 | */ |
||
92 | protected $client; |
||
93 | |||
94 | /** |
||
95 | * @var \Psr\Log\LoggerInterface |
||
96 | */ |
||
97 | protected $logger; |
||
98 | |||
99 | /** |
||
100 | * @var array |
||
101 | */ |
||
102 | protected $standards; |
||
103 | |||
104 | /** |
||
105 | * @var \FeedIo\Reader\FixerSet |
||
106 | */ |
||
107 | protected $fixerSet; |
||
108 | |||
109 | /** |
||
110 | * @param \FeedIo\Adapter\ClientInterface $client |
||
111 | * @param \Psr\Log\LoggerInterface $logger |
||
112 | */ |
||
113 | 13 | public function __construct(ClientInterface $client, LoggerInterface $logger, DateTimeBuilderInterface $dateTimeBuilder = null) |
|
122 | |||
123 | /** |
||
124 | * Loads main standards (RSS, RDF, Atom) in current object's attributes |
||
125 | * |
||
126 | * @return FeedIo |
||
127 | */ |
||
128 | 13 | protected function loadCommonStandards() : FeedIo |
|
137 | |||
138 | /** |
||
139 | * adds a filter to the reader |
||
140 | * |
||
141 | * @param \FeedIo\FilterInterface $filter |
||
142 | * @return FeedIo |
||
143 | */ |
||
144 | 2 | public function addFilter(FilterInterface $filter) : FeedIo |
|
150 | |||
151 | /** |
||
152 | * Returns main standards |
||
153 | * |
||
154 | * @return array |
||
155 | */ |
||
156 | 13 | public function getCommonStandards() : array |
|
162 | |||
163 | /** |
||
164 | * @param string $name |
||
165 | * @param \FeedIo\StandardAbstract $standard |
||
166 | * @return FeedIo |
||
167 | */ |
||
168 | 13 | public function addStandard(string $name, StandardAbstract $standard) : FeedIo |
|
177 | |||
178 | /** |
||
179 | * @param string $format |
||
180 | * @param StandardAbstract $standard |
||
181 | * @return ParserAbstract |
||
182 | */ |
||
183 | 12 | public function newParser(string $format, StandardAbstract $standard) : ParserAbstract |
|
193 | |||
194 | /** |
||
195 | * @return \FeedIo\Reader\FixerSet |
||
196 | */ |
||
197 | 1 | public function getFixerSet() : FixerSet |
|
201 | |||
202 | /** |
||
203 | * @return FeedIo |
||
204 | */ |
||
205 | 12 | protected function loadFixerSet() : FeedIo |
|
216 | |||
217 | /** |
||
218 | * @param FixerAbstract $fixer |
||
219 | * @return FeedIo |
||
220 | */ |
||
221 | 12 | public function addFixer(FixerAbstract $fixer) : FeedIo |
|
228 | |||
229 | /** |
||
230 | * @return array |
||
231 | */ |
||
232 | 12 | public function getBaseFixers() : array |
|
240 | |||
241 | /** |
||
242 | * @param array $formats |
||
243 | * @return FeedIo |
||
244 | */ |
||
245 | 1 | public function addDateFormats(array $formats) : FeedIo |
|
253 | |||
254 | /** |
||
255 | * @return \FeedIo\Rule\DateTimeBuilder |
||
256 | */ |
||
257 | 13 | public function getDateTimeBuilder() : DateTimeBuilder |
|
261 | |||
262 | /** |
||
263 | * @return \FeedIo\Reader |
||
264 | */ |
||
265 | 4 | public function getReader() : Reader |
|
269 | |||
270 | /** |
||
271 | * @param \FeedIo\Reader $reader |
||
272 | * @return FeedIo |
||
273 | */ |
||
274 | 13 | public function setReader(Reader $reader) : FeedIo |
|
280 | |||
281 | /** |
||
282 | * Discover feeds from the webpage's headers |
||
283 | * @param string $url |
||
284 | * @return array |
||
285 | */ |
||
286 | 1 | public function discover(string $url) : array |
|
292 | |||
293 | /** |
||
294 | * @param iterable $requests |
||
295 | * @param CallbackInterface $callback |
||
296 | * @param string $feedClass |
||
297 | */ |
||
298 | public function readAsync(iterable $requests, CallbackInterface $callback, string $feedClass = '\FeedIo\Feed') : void |
||
304 | |||
305 | /** |
||
306 | * @param string $url |
||
307 | * @param FeedInterface $feed |
||
308 | * @param \DateTime $modifiedSince |
||
309 | * @return \FeedIo\Reader\Result |
||
310 | */ |
||
311 | 2 | public function read(string $url, FeedInterface $feed = null, \DateTime $modifiedSince = null) : Result |
|
328 | |||
329 | /** |
||
330 | * @param string $url |
||
331 | * @param \DateTime $modifiedSince |
||
332 | * @return \FeedIo\Reader\Result |
||
333 | */ |
||
334 | 1 | public function readSince(string $url, \DateTime $modifiedSince) : Result |
|
338 | |||
339 | /** |
||
340 | * @return FeedIo |
||
341 | */ |
||
342 | 1 | public function resetFilters() : FeedIo |
|
348 | |||
349 | /** |
||
350 | * Get a PSR-7 compliant response for the given feed |
||
351 | * |
||
352 | * @param \FeedIo\FeedInterface $feed |
||
353 | * @param string $standard |
||
354 | * @param int $maxAge |
||
355 | * @param bool $public |
||
356 | * @return ResponseInterface |
||
357 | */ |
||
358 | 1 | public function getPsrResponse(FeedInterface $feed, string $standard, int $maxAge = 600, bool $public = true) : ResponseInterface |
|
367 | |||
368 | /** |
||
369 | * @param FeedInterface $feed |
||
370 | * @param string $standard Standard's name |
||
371 | * @return string |
||
372 | */ |
||
373 | 1 | public function format(FeedInterface $feed, string $standard) : string |
|
381 | |||
382 | /** |
||
383 | * @param \FeedIo\FeedInterface $feed |
||
384 | * @return string |
||
385 | */ |
||
386 | 1 | public function toRss(FeedInterface $feed) : string |
|
390 | |||
391 | /** |
||
392 | * @param \FeedIo\FeedInterface $feed |
||
393 | * @return string |
||
394 | */ |
||
395 | 1 | public function toAtom(FeedInterface $feed) : string |
|
399 | |||
400 | /** |
||
401 | * @param \FeedIo\FeedInterface $feed |
||
402 | * @return string |
||
403 | */ |
||
404 | 1 | public function toJson(FeedInterface $feed) : string |
|
408 | |||
409 | |||
410 | /** |
||
411 | * @param string $name |
||
412 | * @return \FeedIo\StandardAbstract |
||
413 | * @throws \OutOfBoundsException |
||
414 | */ |
||
415 | 3 | public function getStandard(string $name) : StandardAbstract |
|
424 | |||
425 | /** |
||
426 | * @param \FeedIo\FeedInterface $feed |
||
427 | * @param string $message |
||
428 | * @return FeedIo |
||
429 | */ |
||
430 | 3 | protected function logAction(FeedInterface $feed, string $message) : FeedIo |
|
437 | } |
||
438 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.