Fix various phpstan errors

This commit is contained in:
James Cole
2023-11-05 16:11:09 +01:00
parent 998fed7782
commit 5b05fb07ae
5 changed files with 17 additions and 19 deletions

View File

@@ -226,7 +226,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
// get bindable.
if (TransactionJournal::class === $attachment->attachable_type) {
// is linked to journal, get group of journal (if not also deleted)
/** @var TransactionJournal $journal */
/** @var TransactionJournal|null $journal */
$journal = $user->transactionJournals()->withTrashed()->find($attachment->attachable_id);
if (null !== $journal) {
return redirect(route('transactions.show', [$journal->transaction_group_id]));
@@ -234,7 +234,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
}
if (Bill::class === $attachment->attachable_type) {
// is linked to bill.
/** @var Bill $bill */
/** @var Bill|null $bill */
$bill = $user->bills()->withTrashed()->find($attachment->attachable_id);
if (null !== $bill) {
return redirect(route('bills.show', [$bill->id]));