aboutsummaryrefslogtreecommitdiff
path: root/classes/Pref_Prefs.php
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2024-11-13 18:38:32 +0000
committerAndrew Dolgov <fox@fakecake.org>2024-11-13 18:38:32 +0000
commit394d606fe977a331f733c62e5509469c2eb3ef31 (patch)
tree27832a131eafec209a8de1361c35c69baa45231f /classes/Pref_Prefs.php
parent6273e26ea463e2762f2d736455f4912de7171cfa (diff)
parent859ce4d7f69a46716a10eacc485ffaf9867a76d4 (diff)
Merge branch 'feature/phpstan-2.0.x' into 'master'
PHPStan 2.0.x See merge request tt-rss/tt-rss!74
Diffstat (limited to 'classes/Pref_Prefs.php')
-rw-r--r--classes/Pref_Prefs.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/classes/Pref_Prefs.php b/classes/Pref_Prefs.php
index dd28bd3f2..47d6886f9 100644
--- a/classes/Pref_Prefs.php
+++ b/classes/Pref_Prefs.php
@@ -177,7 +177,7 @@ class Pref_Prefs extends Handler_Protected {
$authenticator = PluginHost::getInstance()->get_plugin($_SESSION["auth_module"]);
if (implements_interface($authenticator, "IAuthModule2")) {
- /** @var IAuthModule2 $authenticator */
+ /** @var Plugin&IAuthModule2 $authenticator */
print format_notice($authenticator->change_password($_SESSION["uid"], $old_pw, $new_pw));
} else {
print "ERROR: ".format_error("Function not supported by authentication module.");
@@ -976,7 +976,7 @@ class Pref_Prefs extends Handler_Protected {
$authenticator = PluginHost::getInstance()->get_plugin($_SESSION["auth_module"]);
- /** @var Auth_Internal|false $authenticator -- this is only here to make check_password() visible to static analyzer */
+ /** @var Auth_Internal|null $authenticator -- this is only here to make check_password() visible to static analyzer */
if ($authenticator->check_password($_SESSION["uid"], $password)) {
if (UserHelper::enable_otp($_SESSION["uid"], $otp_check)) {
print "OK";
@@ -991,7 +991,7 @@ class Pref_Prefs extends Handler_Protected {
function otpdisable(): void {
$password = clean($_REQUEST["password"]);
- /** @var Auth_Internal|false $authenticator -- this is only here to make check_password() visible to static analyzer */
+ /** @var Auth_Internal|null $authenticator -- this is only here to make check_password() visible to static analyzer */
$authenticator = PluginHost::getInstance()->get_plugin($_SESSION["auth_module"]);
if ($authenticator->check_password($_SESSION["uid"], $password)) {
@@ -1316,14 +1316,8 @@ class Pref_Prefs extends Handler_Protected {
function updateLocalPlugins(): void {
if ($_SESSION["access_level"] >= UserHelper::ACCESS_LEVEL_ADMIN) {
- $plugins = explode(",", $_REQUEST["plugins"] ?? "");
-
- if ($plugins !== false) {
- $plugins = array_filter($plugins, 'strlen');
- }
-
+ $plugins = array_filter(explode(",", $_REQUEST["plugins"] ?? ""), "strlen");
$root_dir = Config::get_self_dir();
-
$rv = [];
if ($plugins) {