Skip to content

Commit

Permalink
Update feed's lastModified if lesser than the item's. fix #323
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdebril committed Jan 29, 2021
1 parent fdc54f9 commit b2eb170
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 252 deletions.
3 changes: 3 additions & 0 deletions src/FeedIo/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ public function rewind()
*/
public function add(ItemInterface $item) : FeedInterface
{
if ($item->getLastModified() > $this->getLastModified()) {
$this->setLastModified($item->getLastModified());
}
$this->items->append($item);

return $this;
Expand Down
2 changes: 0 additions & 2 deletions src/FeedIo/FeedIo.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ public function addFixer(FixerAbstract $fixer) : FeedIo
public function getBaseFixers() : array
{
return array(
new Reader\Fixer\LastModified(),
new Reader\Fixer\LastModifiedSince(),
new Reader\Fixer\HttpLastModified(),
new Reader\Fixer\PublicId(),
);
Expand Down
55 changes: 0 additions & 55 deletions src/FeedIo/Reader/Fixer/LastModified.php

This file was deleted.

38 changes: 0 additions & 38 deletions src/FeedIo/Reader/Fixer/LastModifiedSince.php

This file was deleted.

77 changes: 0 additions & 77 deletions tests/FeedIo/Reader/Fixer/LastModifiedSinceTest.php

This file was deleted.

80 changes: 0 additions & 80 deletions tests/FeedIo/Reader/Fixer/LastModifiedTest.php

This file was deleted.

0 comments on commit b2eb170

Please sign in to comment.