deal with phpstan warnings in auto_assign_labels and bookmarklets

This commit is contained in:
Andrew Dolgov 2021-11-14 21:14:21 +03:00
parent f537502fce
commit 5f808051b2
2 changed files with 10 additions and 4 deletions

View File

@ -11,7 +11,12 @@ class Auto_Assign_Labels extends Plugin {
$host->add_hook($host::HOOK_ARTICLE_FILTER, $this); $host->add_hook($host::HOOK_ARTICLE_FILTER, $this);
} }
function get_all_labels_filter_format($owner_uid) { /**
* @param int $owner_uid
* @return array<int, array<int, int|string>>
* @throws PDOException
*/
private function get_all_labels_filter_format(int $owner_uid) : array {
$rv = array(); $rv = array();
// TODO: use Labels::get_all() // TODO: use Labels::get_all()

View File

@ -1,5 +1,7 @@
<?php <?php
class Bookmarklets extends Plugin { class Bookmarklets extends Plugin {
/** @var PluginHost $host */
private $host; private $host;
function about() { function about() {
@ -20,7 +22,7 @@ class Bookmarklets extends Plugin {
return in_array($method, ["subscribe", "sharepopup"]); return in_array($method, ["subscribe", "sharepopup"]);
} }
function subscribe() { function subscribe() : void {
if (Config::get(Config::SINGLE_USER_MODE)) { if (Config::get(Config::SINGLE_USER_MODE)) {
UserHelper::login_sequence(); UserHelper::login_sequence();
} }
@ -171,7 +173,7 @@ class Bookmarklets extends Plugin {
} }
} }
function sharepopup() { function sharepopup() : void {
if (Config::get(Config::SINGLE_USER_MODE)) { if (Config::get(Config::SINGLE_USER_MODE)) {
UserHelper::login_sequence(); UserHelper::login_sequence();
} }
@ -332,7 +334,6 @@ class Bookmarklets extends Plugin {
<?php <?php
} }
function hook_prefs_tab($args) { function hook_prefs_tab($args) {
if ($args != "prefFeeds") if ($args != "prefFeeds")
return; return;