summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-11-14 21:20:59 +0300
committerAndrew Dolgov <[email protected]>2021-11-14 21:20:59 +0300
commit242cf916eff84325c4ab30fdc4dc24292ab6127f (patch)
tree24653232507f34c905f2be815c75f02bc83c09f2 /plugins
parent5f808051b2bdb2e43f16693ba19b20940944d556 (diff)
deal with phpstan warnings in plugins/note, nsfw, and share
Diffstat (limited to 'plugins')
-rw-r--r--plugins/note/init.php4
-rw-r--r--plugins/nsfw/init.php11
-rw-r--r--plugins/share/init.php5
3 files changed, 12 insertions, 8 deletions
diff --git a/plugins/note/init.php b/plugins/note/init.php
index bc3df64b1..28d3c8c3a 100644
--- a/plugins/note/init.php
+++ b/plugins/note/init.php
@@ -21,7 +21,7 @@ class Note extends Plugin {
style='cursor : pointer' title='".__('Edit article note')."'>note</i>";
}
- function edit() {
+ function edit() : void {
$id = clean($_REQUEST['id']);
$sth = $this->pdo->prepare("SELECT note FROM ttrss_user_entries WHERE
@@ -49,7 +49,7 @@ class Note extends Plugin {
<?php
}
- function setNote() {
+ function setNote() : void {
$id = (int)clean($_REQUEST["id"]);
$note = clean($_REQUEST["note"]);
diff --git a/plugins/nsfw/init.php b/plugins/nsfw/init.php
index fc38fef71..a349ceac0 100644
--- a/plugins/nsfw/init.php
+++ b/plugins/nsfw/init.php
@@ -1,5 +1,7 @@
<?php
class NSFW extends Plugin {
+
+ /** @var PluginHost $host */
private $host;
function about() {
@@ -31,7 +33,12 @@ class NSFW extends Plugin {
}
}
- private function rewrite_contents($article) {
+ /**
+ * @param array<string, mixed> $article
+ * @return array<string,mixed>
+ * @throws PDOException
+ */
+ private function rewrite_contents(array $article) : array {
$tags = explode(",", $this->host->get($this, "tags"));
$article_tags = $article["tags"];
@@ -101,7 +108,7 @@ class NSFW extends Plugin {
<?php
}
- function save() {
+ function save() : void {
$tags = implode(", ",
FeedItem_Common::normalize_categories(explode(",", $_POST["tags"] ?? "")));
diff --git a/plugins/share/init.php b/plugins/share/init.php
index b900de5c0..0b14c673b 100644
--- a/plugins/share/init.php
+++ b/plugins/share/init.php
@@ -194,10 +194,7 @@ class Share extends Plugin {
strip_tags($content_decoded)
)
), 500, "...")) ?>">
-
- <?php if ($og_image) { ?>
- <meta property='og:image' content="<?= htmlspecialchars($og_image) ?>">
- <?php } ?>
+ <meta property='og:image' content="<?= htmlspecialchars($og_image) ?>">
</head>
<body class='flat ttrss_utility ttrss_zoom css_loading'>