mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Fix a lot of phpstan things
This commit is contained in:
@@ -92,6 +92,11 @@ class BudgetLimitHandler
|
||||
app('log')->error($e->getMessage());
|
||||
$viewRange = '1M';
|
||||
}
|
||||
// safety catch
|
||||
if(null === $viewRange || is_array($viewRange)){
|
||||
$viewRange = '1M';
|
||||
}
|
||||
$viewRange = (string)$viewRange;
|
||||
|
||||
$start = app('navigation')->startOfPeriod($budgetLimit->start_date, $viewRange);
|
||||
$end = app('navigation')->startOfPeriod($budgetLimit->end_date, $viewRange);
|
||||
|
||||
@@ -197,6 +197,9 @@ class UserEventHandler
|
||||
}
|
||||
|
||||
$list = app('preferences')->getForUser($user, 'login_ip_history', [])->data;
|
||||
if(!is_array($list)) {
|
||||
$list = [];
|
||||
}
|
||||
|
||||
/** @var array $entry */
|
||||
foreach ($list as $index => $entry) {
|
||||
@@ -415,7 +418,7 @@ class UserEventHandler
|
||||
}
|
||||
// clean up old entries (6 months)
|
||||
$carbon = Carbon::createFromFormat('Y-m-d H:i:s', $preference[$index]['time']);
|
||||
if ($carbon->diffInMonths(today()) > 6) {
|
||||
if (false !== $carbon && $carbon->diffInMonths(today()) > 6) {
|
||||
app('log')->debug(sprintf('Entry for %s is very old, remove it.', $row['ip']));
|
||||
unset($preference[$index]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user