Add+use FeedParser::FEED_UNKNOWN

This commit is contained in:
wn_
2024-11-26 16:50:51 +00:00
parent d85bdcfd78
commit b5777b5a7c

View File

@@ -25,6 +25,7 @@ class FeedParser {
/** @var DOMXPath|null */
private $xpath;
const FEED_UNKNOWN = -1;
const FEED_RDF = 0;
const FEED_RSS = 1;
const FEED_ATOM = 2;
@@ -76,10 +77,10 @@ class FeedParser {
'rdf:rdf' => $this::FEED_RDF,
'channel' => $this::FEED_RSS,
'feed', 'atom:feed' => $this::FEED_ATOM,
default => null,
default => $this::FEED_UNKNOWN,
};
if ($this->type === null) {
if ($this->type === $this::FEED_UNKNOWN) {
$this->error ??= 'Unknown/unsupported feed type';
return;
}