mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Improve test coverage.
This commit is contained in:
@@ -431,31 +431,6 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
|
||||
return $savePerMonth;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PiggyBankEvent $event
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getTransactionWithEvent(PiggyBankEvent $event): ?int
|
||||
{
|
||||
$journal = $event->transactionJournal;
|
||||
if (null === $journal) {
|
||||
return null;
|
||||
}
|
||||
if ((float)$event->amount < 0) {
|
||||
$transaction = $journal->transactions()->where('amount', '<', 0)->first();
|
||||
|
||||
return $transaction->id ?? null;
|
||||
}
|
||||
if ((float)$event->amount > 0) {
|
||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||
|
||||
return $transaction->id ?? null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get for piggy account what is left to put in piggies.
|
||||
*
|
||||
|
Reference in New Issue
Block a user