Minor fix to DOMNodeList#item() potential type (null vs false)
This commit is contained in:
parent
85b974af32
commit
109b702ed0
|
@ -602,7 +602,7 @@ class Article extends Handler_Protected {
|
||||||
} else if ($e->nodeName == "video") {
|
} else if ($e->nodeName == "video") {
|
||||||
$article_image = $e->getAttribute("poster");
|
$article_image = $e->getAttribute("poster");
|
||||||
|
|
||||||
/** @var DOMElement|false $src */
|
/** @var DOMElement|null $src */
|
||||||
$src = $tmpxpath->query("//source[@src]", $e)->item(0);
|
$src = $tmpxpath->query("//source[@src]", $e)->item(0);
|
||||||
|
|
||||||
if ($src) {
|
if ($src) {
|
||||||
|
|
|
@ -69,7 +69,7 @@ class FeedParser {
|
||||||
|
|
||||||
if (!empty($root_list) && $root_list->length > 0) {
|
if (!empty($root_list) && $root_list->length > 0) {
|
||||||
|
|
||||||
/** @var DOMElement|false $root */
|
/** @var DOMElement|null $root */
|
||||||
$root = $root_list->item(0);
|
$root = $root_list->item(0);
|
||||||
|
|
||||||
if ($root) {
|
if ($root) {
|
||||||
|
|
|
@ -32,7 +32,7 @@ class Af_Comics_ComicPress extends Af_ComicFilter {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var DOMElement|false $webtoon_link (buni specific) */
|
/** @var DOMElement|null $webtoon_link (buni specific) */
|
||||||
$webtoon_link = $xpath->query("//a[contains(@href,'www.webtoons.com')]")->item(0);
|
$webtoon_link = $xpath->query("//a[contains(@href,'www.webtoons.com')]")->item(0);
|
||||||
|
|
||||||
if ($webtoon_link) {
|
if ($webtoon_link) {
|
||||||
|
|
|
@ -22,7 +22,7 @@ class Af_Comics_Dilbert extends Af_ComicFilter {
|
||||||
if ($res && $doc->loadHTML($res)) {
|
if ($res && $doc->loadHTML($res)) {
|
||||||
$xpath = new DOMXPath($doc);
|
$xpath = new DOMXPath($doc);
|
||||||
|
|
||||||
/** @var DOMElement|false $basenode (image container) */
|
/** @var DOMElement|null $basenode (image container) */
|
||||||
$basenode = $xpath->query('(//div[@class="img-comic-container"]/a[@class="img-comic-link"])')->item(0);
|
$basenode = $xpath->query('(//div[@class="img-comic-container"]/a[@class="img-comic-link"])')->item(0);
|
||||||
|
|
||||||
// Get the comic title
|
// Get the comic title
|
||||||
|
|
|
@ -50,7 +50,7 @@ class Af_Comics_Gocomics extends Af_ComicFilter {
|
||||||
if (@$doc->loadHTML($body)) {
|
if (@$doc->loadHTML($body)) {
|
||||||
$xpath = new DOMXPath($doc);
|
$xpath = new DOMXPath($doc);
|
||||||
|
|
||||||
/** @var DOMElement|false $node */
|
/** @var DOMElement|null $node */
|
||||||
$node = $xpath->query('//picture[contains(@class, "item-comic-image")]/img')->item(0);
|
$node = $xpath->query('//picture[contains(@class, "item-comic-image")]/img')->item(0);
|
||||||
|
|
||||||
if ($node) {
|
if ($node) {
|
||||||
|
|
|
@ -287,7 +287,7 @@ class Af_RedditImgur extends Plugin {
|
||||||
|
|
||||||
$this->generated_enclosures = [];
|
$this->generated_enclosures = [];
|
||||||
|
|
||||||
/** @var DOMElement|false $anchor -- embed anchor element, before reddit <table> post layout */
|
/** @var DOMElement|null $anchor -- embed anchor element, before reddit <table> post layout */
|
||||||
$anchor = $xpath->query('//body/*')->item(0);
|
$anchor = $xpath->query('//body/*')->item(0);
|
||||||
|
|
||||||
// deal with json-provided media content first
|
// deal with json-provided media content first
|
||||||
|
|
Loading…
Reference in New Issue