/** * Find the feed title. * * @param SimpleXMLElement $xml Feed xml * @param \PicoFeed\Parser\Feed $feed Feed object */ public function findFeedTitle(SimpleXMLElement $xml, Feed $feed) { $title = XmlParser::getXPathResult($xml, 'rss:channel/rss:title', $this->namespaces) ?: XmlParser::getXPathResult($xml, 'channel/title') ?: $xml->channel->title; $feed->setTitle(Filter::stripWhiteSpace(XmlParser::getValue($title)) ?: $feed->getSiteUrl()); }
/** * Find the feed title. * * @param SimpleXMLElement $xml Feed xml * @param \PicoFeed\Parser\Feed $feed Feed object */ public function findFeedTitle(SimpleXMLElement $xml, Feed $feed) { $title = XmlParser::getXPathResult($xml, 'channel/title'); $feed->setTitle(Filter::stripWhiteSpace(XmlParser::getValue($title)) ?: $feed->getSiteUrl()); }