af_redditimgur: set some @var hints

This commit is contained in:
Andrew Dolgov 2021-10-22 12:33:55 +03:00
parent 377e0b812c
commit 6fe0751038
1 changed files with 5 additions and 0 deletions

View File

@ -468,6 +468,7 @@ class Af_RedditImgur extends Plugin {
if (@$cdoc->loadHTML($content)) { if (@$cdoc->loadHTML($content)) {
$cxpath = new DOMXPath($cdoc); $cxpath = new DOMXPath($cdoc);
/** @var ?DOMElement $rel_image */
$rel_image = $cxpath->query("//link[@rel='image_src']")->item(0); $rel_image = $cxpath->query("//link[@rel='image_src']")->item(0);
if ($rel_image) { if ($rel_image) {
@ -514,7 +515,10 @@ class Af_RedditImgur extends Plugin {
if (@$cdoc->loadHTML($content)) { if (@$cdoc->loadHTML($content)) {
$cxpath = new DOMXPath($cdoc); $cxpath = new DOMXPath($cdoc);
/** @var ?DOMElement $og_image */
$og_image = $cxpath->query("//meta[@property='og:image']")->item(0); $og_image = $cxpath->query("//meta[@property='og:image']")->item(0);
/** @var ?DOMElement $og_video */
$og_video = $cxpath->query("//meta[@property='og:video']")->item(0); $og_video = $cxpath->query("//meta[@property='og:video']")->item(0);
if ($og_video) { if ($og_video) {
@ -577,6 +581,7 @@ class Af_RedditImgur extends Plugin {
if (@$doc->loadHTML($article["content"])) { if (@$doc->loadHTML($article["content"])) {
$xpath = new DOMXPath($doc); $xpath = new DOMXPath($doc);
/** @var ?DOMElement $content_link */
$content_link = $xpath->query("(//a[contains(., '[link]')])")->item(0); $content_link = $xpath->query("(//a[contains(., '[link]')])")->item(0);
if ($this->host->get($this, "enable_content_dupcheck")) { if ($this->host->get($this, "enable_content_dupcheck")) {