summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2022-07-31 13:55:09 +0300
committerAndrew Dolgov <[email protected]>2022-07-31 13:55:09 +0300
commit26c67dba776e1e6f8ac40eed70fe79995325863d (patch)
tree862b043fa666e44ed0b2c997a98b1a256b26ee12 /classes
parentd5c043e8467881c00b2cd836f2f37b8479cf0b96 (diff)
update phpstan to 1.8.2
Diffstat (limited to 'classes')
-rwxr-xr-xclasses/feeditem/atom.php6
-rwxr-xr-xclasses/feeds.php6
-rwxr-xr-xclasses/pref/filters.php1
-rwxr-xr-xclasses/rssutils.php2
4 files changed, 10 insertions, 5 deletions
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;