mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-10-17 05:50:59 +02:00
Add some DOMElement hints to help PHPStan.
This commit is contained in:
parent
348d9ec12e
commit
2d880e6c7d
@ -100,6 +100,7 @@ class FeedParser {
|
|||||||
if (empty($articles) || $articles->length == 0)
|
if (empty($articles) || $articles->length == 0)
|
||||||
$articles = $xpath->query("//atom03:entry");
|
$articles = $xpath->query("//atom03:entry");
|
||||||
|
|
||||||
|
/** @var DOMElement $article */
|
||||||
foreach ($articles as $article) {
|
foreach ($articles as $article) {
|
||||||
array_push($this->items, new FeedItem_Atom($article, $this->doc, $this->xpath));
|
array_push($this->items, new FeedItem_Atom($article, $this->doc, $this->xpath));
|
||||||
}
|
}
|
||||||
@ -124,6 +125,7 @@ class FeedParser {
|
|||||||
|
|
||||||
$articles = $xpath->query("//channel/item");
|
$articles = $xpath->query("//channel/item");
|
||||||
|
|
||||||
|
/** @var DOMElement $article */
|
||||||
foreach ($articles as $article) {
|
foreach ($articles as $article) {
|
||||||
array_push($this->items, new FeedItem_RSS($article, $this->doc, $this->xpath));
|
array_push($this->items, new FeedItem_RSS($article, $this->doc, $this->xpath));
|
||||||
}
|
}
|
||||||
@ -146,6 +148,7 @@ class FeedParser {
|
|||||||
|
|
||||||
$articles = $xpath->query("//rssfake:item");
|
$articles = $xpath->query("//rssfake:item");
|
||||||
|
|
||||||
|
/** @var DOMElement $article */
|
||||||
foreach ($articles as $article) {
|
foreach ($articles as $article) {
|
||||||
array_push($this->items, new FeedItem_RSS($article, $this->doc, $this->xpath));
|
array_push($this->items, new FeedItem_RSS($article, $this->doc, $this->xpath));
|
||||||
}
|
}
|
||||||
|
@ -252,6 +252,7 @@ class OPML extends Handler_Protected {
|
|||||||
$outlines = $xpath->query("//outline[@title]");
|
$outlines = $xpath->query("//outline[@title]");
|
||||||
|
|
||||||
// cleanup empty categories
|
// cleanup empty categories
|
||||||
|
/** @var DOMElement $node */
|
||||||
foreach ($outlines as $node) {
|
foreach ($outlines as $node) {
|
||||||
if ($node->getElementsByTagName('outline')->length == 0)
|
if ($node->getElementsByTagName('outline')->length == 0)
|
||||||
$node->parentNode->removeChild($node);
|
$node->parentNode->removeChild($node);
|
||||||
@ -540,6 +541,7 @@ class OPML extends Handler_Protected {
|
|||||||
//$this->opml_notice("[CAT] $cat_title id: $cat_id P_id: $parent_id");
|
//$this->opml_notice("[CAT] $cat_title id: $cat_id P_id: $parent_id");
|
||||||
$this->opml_notice(T_sprintf("Processing category: %s", $cat_title ? $cat_title : __("Uncategorized")), $nest);
|
$this->opml_notice(T_sprintf("Processing category: %s", $cat_title ? $cat_title : __("Uncategorized")), $nest);
|
||||||
|
|
||||||
|
/** @var DOMElement $node */
|
||||||
foreach ($outlines as $node) {
|
foreach ($outlines as $node) {
|
||||||
if ($node->hasAttributes() && strtolower($node->tagName) == "outline") {
|
if ($node->hasAttributes() && strtolower($node->tagName) == "outline") {
|
||||||
$attrs = $node->attributes;
|
$attrs = $node->attributes;
|
||||||
|
@ -16,6 +16,7 @@ class No_Iframes extends Plugin {
|
|||||||
$xpath = new DOMXpath($doc);
|
$xpath = new DOMXpath($doc);
|
||||||
$entries = $xpath->query('//iframe');
|
$entries = $xpath->query('//iframe');
|
||||||
|
|
||||||
|
/** @var DOMElement $entry */
|
||||||
foreach ($entries as $entry) {
|
foreach ($entries as $entry) {
|
||||||
if (!Sanitizer::iframe_whitelisted($entry))
|
if (!Sanitizer::iframe_whitelisted($entry))
|
||||||
$entry->parentNode->removeChild($entry);
|
$entry->parentNode->removeChild($entry);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user