summaryrefslogtreecommitdiff
path: root/init.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-11-10 21:02:49 +0300
committerAndrew Dolgov <[email protected]>2021-11-10 21:02:49 +0300
commita17d9e319bf211908374ee264c07ac564bc7b2e7 (patch)
tree999eb7b08a8ac830bcff57a20cc03f509c5ec09c /init.php
parentd0d02aa1193435ec98892d49453ab319cb6a3b9d (diff)
phpstan 1.0 cleanup
Diffstat (limited to 'init.php')
-rwxr-xr-xinit.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/init.php b/init.php
index 122abe5..1efd04b 100755
--- a/init.php
+++ b/init.php
@@ -197,7 +197,7 @@ class Af_Img_Phash extends Plugin {
$this->host->set($this, "enabled_feeds", $enabled_feeds);
}
- private function rewrite_duplicate(DOMDocument $doc, DOMNode $elem, bool $api_mode = false) {
+ private function rewrite_duplicate(DOMDocument $doc, DOMElement $elem, bool $api_mode = false) {
if ($elem->hasAttribute("src")) {
$uri = validate_url($elem->getAttribute("src"));
@@ -205,6 +205,7 @@ class Af_Img_Phash extends Plugin {
} else if ($elem->hasAttribute("poster")) {
$check_uri = validate_url($elem->getAttribute("poster"));
+ /** @var DOMElement|false */
$video_source = $elem->getElementsByTagName("source")->item(0);
if ($video_source) {
@@ -331,6 +332,7 @@ class Af_Img_Phash extends Plugin {
_debug("phash: calculated perceptual hash: $hash");
// we managed to process this image, it should be safe to remove the flag now
+ // @phpstan-ignore-next-line
if ($this->cache->is_writable() && $this->cache->exists($cached_file_flag))
unlink($this->cache->get_full_path($cached_file_flag));