mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-17 23:28:20 +00:00
Fix a lot of phpstan things
This commit is contained in:
@@ -170,6 +170,9 @@ class TwoFactorController extends Controller
|
||||
private function isBackupCode(string $mfaCode): bool
|
||||
{
|
||||
$list = app('preferences')->get('mfa_recovery', [])->data;
|
||||
if(!is_array($list)) {
|
||||
$list = [];
|
||||
}
|
||||
if (in_array($mfaCode, $list, true)) {
|
||||
return true;
|
||||
}
|
||||
@@ -185,6 +188,9 @@ class TwoFactorController extends Controller
|
||||
private function removeFromBackupCodes(string $mfaCode): void
|
||||
{
|
||||
$list = app('preferences')->get('mfa_recovery', [])->data;
|
||||
if(!is_array($list)) {
|
||||
$list = [];
|
||||
}
|
||||
$newList = array_values(array_diff($list, [$mfaCode]));
|
||||
app('preferences')->set('mfa_recovery', $newList);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user