Use native typing in more places and clean up 'FeedEnclosure' a bit.

This commit is contained in:
wn_
2024-12-10 20:31:16 +00:00
parent 333bab90a7
commit a1bd6cea1b
13 changed files with 71 additions and 115 deletions

View File

@@ -184,11 +184,11 @@ class FeedItem_Atom extends FeedItem_Common {
$base = $this->xpath->evaluate("string(ancestor-or-self::*[@xml:base][1]/@xml:base)", $link);
if ($link->getAttribute("rel") == "enclosure") {
$enc = new FeedEnclosure();
$enc->type = clean($link->getAttribute("type"));
$enc->length = clean($link->getAttribute("length"));
$enc->link = clean($link->getAttribute("href"));
$enc = new FeedEnclosure(
type: clean($link->getAttribute('type')),
length: clean($link->getAttribute('length')),
link: clean($link->getAttribute('href')),
);
if (!empty($base)) {
$enc->link = UrlHelper::rewrite_relative($base, $enc->link);