From 26c67dba776e1e6f8ac40eed70fe79995325863d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 31 Jul 2022 13:55:09 +0300 Subject: update phpstan to 1.8.2 --- classes/feeditem/atom.php | 6 ++++-- classes/feeds.php | 6 ++++-- classes/pref/filters.php | 1 + classes/rssutils.php | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) (limited to 'classes') diff --git a/classes/feeditem/atom.php b/classes/feeditem/atom.php index cac6d8c54..6de790ff9 100755 --- a/classes/feeditem/atom.php +++ b/classes/feeditem/atom.php @@ -43,7 +43,8 @@ class FeedItem_Atom extends FeedItem_Common { $links = $this->elem->getElementsByTagName("link"); foreach ($links as $link) { - if ($link && $link->hasAttribute("href") && + /** @phpstan-ignore-next-line */ + if ($link->hasAttribute("href") && (!$link->hasAttribute("rel") || $link->getAttribute("rel") == "alternate" || $link->getAttribute("rel") == "standout")) { @@ -180,7 +181,8 @@ class FeedItem_Atom extends FeedItem_Common { $encs = []; foreach ($links as $link) { - if ($link && $link->hasAttribute("href") && $link->hasAttribute("rel")) { + /** @phpstan-ignore-next-line */ + if ($link->hasAttribute("href") && $link->hasAttribute("rel")) { $base = $this->xpath->evaluate("string(ancestor-or-self::*[@xml:base][1]/@xml:base)", $link); if ($link->getAttribute("rel") == "enclosure") { diff --git a/classes/feeds.php b/classes/feeds.php index fee0a7708..8981d6f14 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -248,11 +248,12 @@ class Feeds extends Handler_Protected { function ($result, $plugin) use (&$line, &$button_doc) { if ($result && $button_doc->loadXML($result)) { - /** @var DOMElement|null */ + /** @var DOMElement|null $child */ $child = $button_doc->firstChild; if ($child) { do { + /** @var DOMElement|null $child */ $child->setAttribute('data-plugin-name', get_class($plugin)); } while ($child = $child->nextSibling); @@ -271,11 +272,12 @@ class Feeds extends Handler_Protected { function ($result, $plugin) use (&$line, &$button_doc) { if ($result && $button_doc->loadXML($result)) { - /** @var DOMElement|null */ + /** @var DOMElement|null $child */ $child = $button_doc->firstChild; if ($child) { do { + /** @var DOMElement|null $child */ $child->setAttribute('data-plugin-name', get_class($plugin)); } while ($child = $child->nextSibling); diff --git a/classes/pref/filters.php b/classes/pref/filters.php index 8f1c578b6..e7c7877a7 100755 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -115,6 +115,7 @@ class Pref_Filters extends Handler_Protected { $glue = $filter['match_any_rule'] ? " OR " : " AND "; $scope_qpart = join($glue, $scope_qparts); + /** @phpstan-ignore-next-line */ if (!$scope_qpart) $scope_qpart = "true"; $rv = array(); diff --git a/classes/rssutils.php b/classes/rssutils.php index 384830556..e039284f2 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -662,7 +662,7 @@ class RSSUtils { print_r($item); } - if (ini_get("max_execution_time") > 0 && time() - $tstart >= ini_get("max_execution_time") * 0.7) { + if (ini_get("max_execution_time") > 0 && time() - $tstart >= ((float)ini_get("max_execution_time") * 0.7)) { Debug::log("looks like there's too many articles to process at once, breaking out.", Debug::LOG_VERBOSE); $pdo->commit(); break; -- cgit v1.2.3