composer update
This commit is contained in:
parent
9ac51e0523
commit
623395064f
279 changed files with 4458 additions and 16328 deletions
|
@ -9,6 +9,7 @@ use PicoFeed\Client\Url;
|
|||
/**
|
||||
* RSS 2.0 Parser.
|
||||
*
|
||||
* @package PicoFeed\Parser
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class Rss20 extends Parser
|
||||
|
@ -152,17 +153,32 @@ class Rss20 extends Parser
|
|||
}
|
||||
|
||||
/**
|
||||
* Find the item date.
|
||||
* Find the item published date.
|
||||
*
|
||||
* @param SimpleXMLElement $entry Feed item
|
||||
* @param Item $item Item object
|
||||
* @param \PicoFeed\Parser\Feed $feed Feed object
|
||||
*/
|
||||
public function findItemDate(SimpleXMLElement $entry, Item $item, Feed $feed)
|
||||
public function findItemPublishedDate(SimpleXMLElement $entry, Item $item, Feed $feed)
|
||||
{
|
||||
$date = XmlParser::getXPathResult($entry, 'pubDate');
|
||||
|
||||
$item->setDate(empty($date) ? $feed->getDate() : $this->getDateParser()->getDateTime(XmlParser::getValue($date)));
|
||||
$item->setPublishedDate(!empty($date) ? $this->getDateParser()->getDateTime(XmlParser::getValue($date)) : null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the item updated date.
|
||||
*
|
||||
* @param SimpleXMLElement $entry Feed item
|
||||
* @param Item $item Item object
|
||||
* @param \PicoFeed\Parser\Feed $feed Feed object
|
||||
*/
|
||||
public function findItemUpdatedDate(SimpleXMLElement $entry, Item $item, Feed $feed)
|
||||
{
|
||||
if ($item->publishedDate === null) {
|
||||
$this->findItemPublishedDate($entry, $item, $feed);
|
||||
}
|
||||
$item->setUpdatedDate($item->getPublishedDate()); // No updated date in RSS 2.0 specifications
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Reference in a new issue