mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-03-29 19:51:20 -04:00
Pass PHPStan level 8 (#5946)
* Pass PHPStan level 8 And prepare for PHPStan level 9 https://phpstan.org/user-guide/rule-levels * Revert wrong replace in comment * Fix PHPStan level 8 * Update PHPStan and other dev dependencies * Remove obsolete comment * noVariableVariables and towards bleedingEdge https://github.com/phpstan/phpstan-strict-rules https://phpstan.org/blog/what-is-bleeding-edge * More bleedingEdge * A bit more PHPStan level 9 * More PHPStan level 9 * Prepare for booleansInConditions Ignore int and null * Revert wrong line * More fixes * Fix keep_max_n_unread * Stricter attribute functions * Stricter callHooks and more PHPStan level 9 * More typing * A tiny more
This commit is contained in:
committed by
GitHub
parent
6bb45a8726
commit
a80a5f48a1
@@ -13,18 +13,20 @@ class FreshRSS_api_Controller extends FreshRSS_ActionController {
|
||||
*/
|
||||
public static function updatePassword(string $apiPasswordPlain) {
|
||||
$username = Minz_User::name();
|
||||
$userConfig = FreshRSS_Context::$user_conf;
|
||||
if ($username == null) {
|
||||
return _t('feedback.api.password.failed');
|
||||
}
|
||||
|
||||
$apiPasswordHash = FreshRSS_password_Util::hash($apiPasswordPlain);
|
||||
$userConfig->apiPasswordHash = $apiPasswordHash;
|
||||
FreshRSS_Context::userConf()->apiPasswordHash = $apiPasswordHash;
|
||||
|
||||
$feverKey = FreshRSS_fever_Util::updateKey($username, $apiPasswordPlain);
|
||||
if (!$feverKey) {
|
||||
return _t('feedback.api.password.failed');
|
||||
}
|
||||
|
||||
$userConfig->feverKey = $feverKey;
|
||||
if ($userConfig->save()) {
|
||||
FreshRSS_Context::userConf()->feverKey = $feverKey;
|
||||
if (FreshRSS_Context::userConf()->save()) {
|
||||
return false;
|
||||
} else {
|
||||
return _t('feedback.api.password.failed');
|
||||
|
||||
Reference in New Issue
Block a user