| Conditions | 3 |
| Paths | 4 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 16 | public function perform(FeedIo $feedIo, Feed $feed, Result $result): bool |
||
| 17 | {
|
||
| 18 | $lastModifiedDates = []; |
||
| 19 | $result->setModifiedSince($feed->getLastModified()); |
||
| 20 | /** @var \FeedIo\Feed\ItemInterface $item */ |
||
| 21 | foreach ($feed as $i => $item) {
|
||
| 22 | $lastModifiedDates[] = $item->getLastModified(); |
||
| 23 | } |
||
| 24 | sort($lastModifiedDates); |
||
| 25 | $first = current($lastModifiedDates); |
||
| 26 | $last = end($lastModifiedDates); |
||
| 27 | |||
| 28 | $result->setItemDates($lastModifiedDates); |
||
| 29 | if (!($last > $first)) {
|
||
| 30 | $result->markAsFailed(Result::TEST_NORMAL_DATE_FLOW); |
||
| 31 | } |
||
| 32 | return true; |
||
| 33 | } |
||
| 34 | |||
| 36 | } |