Autoformat lol

This commit is contained in:
James Cole
2026-01-23 15:09:50 +01:00
parent ae1347c550
commit 8f15a32bd6
1071 changed files with 21111 additions and 21687 deletions

View File

@@ -40,7 +40,9 @@ class SetAmount implements ActionInterface
/**
* TriggerInterface constructor.
*/
public function __construct(private RuleAction $action) {}
public function __construct(
private RuleAction $action
) {}
public function actOnArray(array $journal): bool
{
@@ -55,7 +57,7 @@ class SetAmount implements ActionInterface
return false;
}
$value = $this->action->getValue($journal);
$value = $this->action->getValue($journal);
if (!is_numeric($value) || 0 === bccomp($value, '0')) {
Log::debug(sprintf('RuleAction SetAmount, amount "%s" is not a number or is zero, will not continue.', $value));
@@ -65,10 +67,10 @@ class SetAmount implements ActionInterface
}
/** @var TransactionJournal $object */
$object = TransactionJournal::where('user_id', $journal['user_id'])->find($journal['transaction_journal_id']);
$object = TransactionJournal::where('user_id', $journal['user_id'])->find($journal['transaction_journal_id']);
$positive = Steam::positive($value);
$negative = Steam::negative($value);
$positive = Steam::positive($value);
$negative = Steam::negative($value);
$this->updatePositive($object, $positive);
$this->updateNegative($object, $negative);
@@ -76,21 +78,23 @@ class SetAmount implements ActionInterface
// event for audit log entry
if (0 !== bccomp($journal['amount'], $value)) {
event(new TriggeredAuditLog(
$this->action->rule,
$object,
'update_amount',
[
'currency_symbol' => $object->transactionCurrency->symbol,
'decimal_places' => $object->transactionCurrency->decimal_places,
'amount' => $journal['amount'],
],
[
'currency_symbol' => $object->transactionCurrency->symbol,
'decimal_places' => $object->transactionCurrency->decimal_places,
'amount' => $value,
]
));
event(
new TriggeredAuditLog(
$this->action->rule,
$object,
'update_amount',
[
'currency_symbol' => $object->transactionCurrency->symbol,
'decimal_places' => $object->transactionCurrency->decimal_places,
'amount' => $journal['amount']
],
[
'currency_symbol' => $object->transactionCurrency->symbol,
'decimal_places' => $object->transactionCurrency->decimal_places,
'amount' => $value
]
)
);
}
return true;