alexdebril/feed-io

View on GitHub
src/FeedIo/Filter/Since.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

declare(strict_types=1);

namespace FeedIo\Filter;

use DateTime;
use FeedIo\Feed\ItemInterface;

class Since implements FilterInterface
{
    private DateTime $date;

    public function __construct(DateTime $date)
    {
        $this->date = $date;
    }

    public function filter(ItemInterface $item): bool
    {
        return $item->getLastModified() >= $this->date;
    }
}