plugin cleanup re: phpstan 1.0 warnings

This commit is contained in:
Andrew Dolgov 2021-11-10 20:58:40 +03:00
parent 9e8d69739f
commit 87a30d88d3
14 changed files with 4 additions and 49 deletions

View File

@ -1,7 +1,6 @@
<?php
class Af_Comics extends Plugin {
private $host;
private $filters = array();
function about() {
@ -11,8 +10,6 @@ class Af_Comics extends Plugin {
}
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_FETCH_FEED, $this);
$host->add_hook($host::HOOK_FEED_BASIC_INFO, $this);
$host->add_hook($host::HOOK_SUBSCRIBE_FEED, $this);

View File

@ -827,6 +827,7 @@ class Af_RedditImgur extends Plugin {
return $this->get_header($url, CURLINFO_CONTENT_TYPE, $useragent);
}
// @phpstan-ignore-next-line
private function get_location($url, $useragent = false) {
return $this->get_header($url, CURLINFO_EFFECTIVE_URL, $useragent);
}

View File

@ -1,6 +1,5 @@
<?php
class Af_Youtube_Embed extends Plugin {
private $host;
function about() {
return array(null,
@ -9,8 +8,6 @@ class Af_Youtube_Embed extends Plugin {
}
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_RENDER_ENCLOSURE, $this);
$host->add_hook($host::HOOK_IFRAME_WHITELISTED, $this);
}

View File

@ -1,6 +1,5 @@
<?php
class Af_Zz_VidMute extends Plugin {
private $host;
function about() {
return array(null,
@ -9,7 +8,7 @@ class Af_Zz_VidMute extends Plugin {
}
function init($host) {
$this->host = $host;
}
function get_js() {
@ -20,4 +19,4 @@ class Af_Zz_VidMute extends Plugin {
return 2;
}
}
}

View File

@ -1,8 +1,6 @@
<?php
class Auth_Internal extends Auth_Base {
private $host;
function about() {
return array(null,
"Authenticates against internal tt-rss database",
@ -10,10 +8,7 @@ class Auth_Internal extends Auth_Base {
true);
}
/* @var PluginHost $host */
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_AUTH_USER, $this);
}

View File

@ -1,8 +1,6 @@
<?php
class Auth_Remote extends Auth_Base {
private $host;
function about() {
return array(null,
"Authenticates against remote password (e.g. supplied by Apache)",
@ -10,10 +8,7 @@ class Auth_Remote extends Auth_Base {
true);
}
/* @var PluginHost $host */
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_AUTH_USER, $this);
}

View File

@ -1,9 +1,6 @@
<?php
class Auto_Assign_Labels extends Plugin {
/* @var PluginHost $host */
private $host;
function about() {
return array(null,
"Assign labels automatically based on article title, content, and tags",
@ -11,8 +8,6 @@ class Auto_Assign_Labels extends Plugin {
}
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_ARTICLE_FILTER, $this);
}

View File

@ -1,7 +1,5 @@
<?php
class Hotkeys_Force_Top extends Plugin {
private $host;
function about() {
return array(null,
"Force open article to the top",
@ -9,7 +7,6 @@ class Hotkeys_Force_Top extends Plugin {
}
function init($host) {
$this->host = $host;
}

View File

@ -1,7 +1,5 @@
<?php
class Hotkeys_Noscroll extends Plugin {
private $host;
function about() {
return array(null,
"n/p (and up/down) hotkeys move between articles without scrolling",
@ -9,8 +7,6 @@ class Hotkeys_Noscroll extends Plugin {
}
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_HOTKEY_MAP, $this);
}

View File

@ -1,8 +1,6 @@
<?php
class Hotkeys_Swap_JK extends Plugin {
private $host;
function about() {
return array(null,
"Swap j and k hotkeys (for vi brethren)",
@ -10,8 +8,6 @@ class Hotkeys_Swap_JK extends Plugin {
}
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_HOTKEY_MAP, $this);
}

View File

@ -1,6 +1,5 @@
<?php
class No_Iframes extends Plugin {
private $host;
function about() {
return array(null,
@ -9,8 +8,6 @@ class No_Iframes extends Plugin {
}
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_SANITIZE, $this);
}

View File

@ -1,9 +1,6 @@
<?php
class Note extends Plugin {
/* @var PluginHost $host */
private $host;
function about() {
return array(null,
"Adds support for setting article notes",
@ -11,8 +8,6 @@ class Note extends Plugin {
}
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
}

View File

@ -1,6 +1,5 @@
<?php
class Shorten_Expanded extends Plugin {
private $host;
function about() {
return array(null,
@ -9,7 +8,7 @@ class Shorten_Expanded extends Plugin {
}
function init($host) {
$this->host = $host;
}
function get_css() {

View File

@ -1,8 +1,6 @@
<?php
class Toggle_Sidebar extends Plugin {
private $host;
function about() {
return array(null,
"Adds a main toolbar button to toggle sidebar",
@ -10,8 +8,6 @@ class Toggle_Sidebar extends Plugin {
}
function init($host) {
$this->host = $host;
$host->add_hook($host::HOOK_MAIN_TOOLBAR_BUTTON, $this);
}