diff --git a/src/lib/Feed.php b/src/lib/Feed.php index 682c0fc..bd15c09 100644 --- a/src/lib/Feed.php +++ b/src/lib/Feed.php @@ -119,7 +119,7 @@ class Feed } }, array_filter($parsed->items, fn(ParsedItem $it) => date_create_immutable($it->updatedOn ?? $it->publishedOn) >= $lastChecked)); - $errors = array_map(fn(Result $it) => $it->getError(), array_filter($results, Result::isError(...))); + $errors = array_map(fn(Result $it) => $it->getError(), array_filter($results, fn($it) => $it->isError())); return sizeof($errors) > 0 ? Result::Error(implode("\n", $errors)) : Result::OK(true); } @@ -194,6 +194,7 @@ class Feed ]; if ($url !== $feed->url) $patch['url'] = $feed->url; Patch::byId(Table::Feed, $feedId, $patch); + return Result::OK(true); }) ->bind(fn() => PURGE_TYPE === self::PurgeNone ? Result::OK(true) : self::purgeItems($feedId)); } catch (DocumentException $ex) { diff --git a/src/lib/ParsedFeed.php b/src/lib/ParsedFeed.php index b113cb2..e75dc83 100644 --- a/src/lib/ParsedFeed.php +++ b/src/lib/ParsedFeed.php @@ -270,7 +270,7 @@ readonly class ParsedFeed ->bind(function (DOMDocument $parsed) use ($doc) { $extract = $parsed->getElementsByTagNameNS(self::ATOM_NS, 'feed')->length > 0 ? self::fromAtom(...) : self::fromRSS(...); - return $extract($parsed, $doc['url']); + return $extract($parsed, $doc->getOK()['url']); }); } }