mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-04 05:06:37 +00:00
Large commit to get rid of a lot of static methods.
This commit is contained in:
@@ -58,7 +58,7 @@ final class AmountExactly extends AbstractTrigger implements TriggerInterface
|
||||
*/
|
||||
public function triggered(TransactionJournal $journal): bool
|
||||
{
|
||||
$amount = $journal->destination_amount ?? TransactionJournal::amountPositive($journal);
|
||||
$amount = $journal->destination_amount ?? $journal->amountPositive();
|
||||
$compare = $this->triggerValue;
|
||||
$result = bccomp($amount, $compare);
|
||||
if ($result === 0) {
|
||||
|
||||
@@ -58,7 +58,7 @@ final class AmountLess extends AbstractTrigger implements TriggerInterface
|
||||
*/
|
||||
public function triggered(TransactionJournal $journal): bool
|
||||
{
|
||||
$amount = $journal->destination_amount ?? TransactionJournal::amountPositive($journal);
|
||||
$amount = $journal->destination_amount ?? $journal->amountPositive();
|
||||
$compare = $this->triggerValue;
|
||||
$result = bccomp($amount, $compare);
|
||||
if ($result === -1) {
|
||||
|
||||
@@ -64,7 +64,7 @@ final class AmountMore extends AbstractTrigger implements TriggerInterface
|
||||
*/
|
||||
public function triggered(TransactionJournal $journal): bool
|
||||
{
|
||||
$amount = $journal->destination_amount ?? TransactionJournal::amountPositive($journal);
|
||||
$amount = $journal->destination_amount ?? $journal->amountPositive();
|
||||
$compare = $this->triggerValue;
|
||||
$result = bccomp($amount, $compare);
|
||||
if ($result === 1) {
|
||||
|
||||
@@ -66,7 +66,7 @@ final class ToAccountContains extends AbstractTrigger implements TriggerInterfac
|
||||
$toAccountName = '';
|
||||
|
||||
/** @var Account $account */
|
||||
foreach (TransactionJournal::destinationAccountList($journal) as $account) {
|
||||
foreach ($journal->destinationAccountList() as $account) {
|
||||
$toAccountName .= strtolower($account->name);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ final class ToAccountEnds extends AbstractTrigger implements TriggerInterface
|
||||
$toAccountName = '';
|
||||
|
||||
/** @var Account $account */
|
||||
foreach (TransactionJournal::destinationAccountList($journal) as $account) {
|
||||
foreach ($journal->destinationAccountList() as $account) {
|
||||
$toAccountName .= strtolower($account->name);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ final class ToAccountIs extends AbstractTrigger implements TriggerInterface
|
||||
$toAccountName = '';
|
||||
|
||||
/** @var Account $account */
|
||||
foreach (TransactionJournal::destinationAccountList($journal) as $account) {
|
||||
foreach ($journal->destinationAccountList() as $account) {
|
||||
$toAccountName .= strtolower($account->name);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ final class ToAccountStarts extends AbstractTrigger implements TriggerInterface
|
||||
$toAccountName = '';
|
||||
|
||||
/** @var Account $account */
|
||||
foreach (TransactionJournal::destinationAccountList($journal) as $account) {
|
||||
foreach ($journal->destinationAccountList() as $account) {
|
||||
$toAccountName .= strtolower($account->name);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user