Various code cleanup

This commit is contained in:
James Cole
2023-01-03 06:48:53 +01:00
parent 6784fe4436
commit 07e4e93632
47 changed files with 118 additions and 211 deletions

View File

@@ -44,6 +44,7 @@ class BillEventHandler
Log::debug(sprintf('Now in %s', __METHOD__));
$bill = $event->bill;
/** @var bool $preference */
$preference = Preferences::getForUser($bill->user, 'notification_bill_reminder', true)->data;
if (true === $preference) {

View File

@@ -125,7 +125,7 @@ class UpdatedGroupEventHandler
return;
}
// first journal:
/** @var TransactionJournal $first */
/** @var TransactionJournal|null $first */
$first = $group->transactionJournals()
->orderBy('transaction_journals.date', 'DESC')
->orderBy('transaction_journals.order', 'ASC')

View File

@@ -143,7 +143,7 @@ class UserEventHandler
throw new FireflyException('Email address can no longer be used for registrations.');
}
}
/** @var UserRole $role */
/** @var UserRole|null $role */
$role = UserRole::where('title', UserRole::OWNER)->first();
if (null === $role) {
throw new FireflyException('The user role is unexpectedly empty. Did you run all migrations?');
@@ -366,6 +366,7 @@ class UserEventHandler
];
}
$preference = array_values($preference);
/** @var bool $send */
$send = app('preferences')->getForUser($user, 'notification_user_login', true)->data;
app('preferences')->setForUser($user, 'login_ip_history', $preference);