mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-04 13:16:31 +00:00
Fix moar phpstan issues.
This commit is contained in:
@@ -238,13 +238,18 @@ class ConvertToWithdrawal implements ActionInterface
|
||||
*/
|
||||
private function getDestinationAccount(TransactionJournal $journal): Account
|
||||
{
|
||||
/** @var null|Transaction $destAccount */
|
||||
$destAccount = $journal->transactions()->where('amount', '>', 0)->first();
|
||||
if (null === $destAccount) {
|
||||
/** @var null|Transaction $destTransaction */
|
||||
$destTransaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||
if (null === $destTransaction) {
|
||||
throw new FireflyException(sprintf('Cannot find destination transaction for journal #%d', $journal->id));
|
||||
}
|
||||
|
||||
return $destAccount->account;
|
||||
/** @var Account|null $res */
|
||||
$res = $destTransaction->account;
|
||||
if(null === $res) {
|
||||
throw new FireflyException('Account is unexpectedly NULL.');
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -258,6 +263,11 @@ class ConvertToWithdrawal implements ActionInterface
|
||||
throw new FireflyException(sprintf('Cannot find source transaction for journal #%d', $journal->id));
|
||||
}
|
||||
|
||||
return $sourceTransaction->account;
|
||||
/** @var Account|null $res */
|
||||
$res = $sourceTransaction->account;
|
||||
if(null === $res) {
|
||||
throw new FireflyException('Account is unexpectedly NULL.');
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user