diff options
| author | 2023-05-11 13:02:04 +0200 | |
|---|---|---|
| committer | 2023-05-11 13:02:04 +0200 | |
| commit | 6e2f2f1c1e98ecd86aa89c6547beb742d7385d18 (patch) | |
| tree | 7ba9f5aebb01d12045b9067a86b5060ba13dca18 /app/Controllers/userController.php | |
| parent | fe7d9bbcd68660a59b813346c236b61b25a51c80 (diff) | |
A few additional PHPStan rules (#5388)
A subset of
https://github.com/phpstan/phpstan-strict-rules
Diffstat (limited to 'app/Controllers/userController.php')
| -rw-r--r-- | app/Controllers/userController.php | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index ed8e6cc44..650f96fb2 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -41,11 +41,9 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController { $userConfig->passwordHash = $passwordHash; } - if (is_array($userConfigUpdated)) { - foreach ($userConfigUpdated as $configName => $configValue) { - if ($configValue !== null) { - $userConfig->_param($configName, $configValue); - } + foreach ($userConfigUpdated as $configName => $configValue) { + if ($configValue !== null) { + $userConfig->_param($configName, $configValue); } } @@ -224,9 +222,7 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController { } } - if (is_array($userConfigOverride)) { - $userConfig = array_merge($userConfig, $userConfigOverride); - } + $userConfig = array_merge($userConfig, $userConfigOverride); $ok = self::checkUsername($new_user_name); $homeDir = join_path(DATA_PATH, 'users', $new_user_name); @@ -234,11 +230,11 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController { if ($ok) { $languages = Minz_Translate::availableLanguages(); - if (empty($userConfig['language']) || !in_array($userConfig['language'], $languages)) { + if (empty($userConfig['language']) || !in_array($userConfig['language'], $languages, true)) { $userConfig['language'] = 'en'; } - $ok &= !in_array(strtoupper($new_user_name), array_map('strtoupper', listUsers())); //Not an existing user, case-insensitive + $ok &= !in_array(strtoupper($new_user_name), array_map('strtoupper', listUsers()), true); //Not an existing user, case-insensitive $configPath = join_path($homeDir, 'config.php'); $ok &= !file_exists($configPath); |
