Conditions | 3 |
Paths | 6 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
15 | public function perform(FeedIo $feedIo, Feed $feed, Result $result): bool |
||
16 | { |
||
17 | try { |
||
18 | $feedIo->read($feed->getUrl(), $feed); |
||
19 | $count = count($feed); |
||
20 | $result->setItemCount($count); |
||
21 | if (0 === $count) { |
||
22 | $result->setNotUpdateable(); |
||
23 | return false; |
||
24 | } |
||
25 | return true; |
||
26 | } catch (\Throwable $exception) { |
||
27 | $result->setNotUpdateable(); |
||
28 | $result->setNotAccessible(); |
||
29 | return false; |
||
30 | } |
||
31 | } |
||
32 | } |
||
33 |