Final set of php8.4 changes.

This commit is contained in:
James Cole
2025-05-04 13:50:20 +02:00
parent 51e86448c7
commit 194d22ad90
58 changed files with 151 additions and 157 deletions

View File

@@ -118,7 +118,7 @@ class TransactionGroupTransformer extends AbstractTransformer
// amount:
$amount = app('steam')->positive((string) ($transaction['amount'] ?? '0'));
$foreignAmount = null;
if (null !== $transaction['foreign_amount'] && '' !== $transaction['foreign_amount'] && 0 !== bccomp('0', $transaction['foreign_amount'])) {
if (null !== $transaction['foreign_amount'] && '' !== $transaction['foreign_amount'] && 0 !== bccomp('0', (string) $transaction['foreign_amount'])) {
$foreignAmount = app('steam')->positive($transaction['foreign_amount']);
}
$type = $this->stringFromArray($transaction, 'transaction_type_type', TransactionTypeEnum::WITHDRAWAL->value);
@@ -132,7 +132,7 @@ class TransactionGroupTransformer extends AbstractTransformer
return [
'user' => (string) $transaction['user_id'],
'transaction_journal_id' => (string) $transaction['transaction_journal_id'],
'type' => strtolower($type),
'type' => strtolower((string) $type),
'date' => $transaction['date']->toAtomString(),
'order' => $transaction['order'],
@@ -296,7 +296,7 @@ class TransactionGroupTransformer extends AbstractTransformer
$type = $journal->transactionType->type;
$currency = $source->transactionCurrency;
$amount = app('steam')->bcround($this->getAmount($source->amount), $currency->decimal_places ?? 0);
$foreignAmount = $this->getForeignAmount(null === $source->foreign_amount ? null : $source->foreign_amount);
$foreignAmount = $this->getForeignAmount($source->foreign_amount ?? null);
$metaFieldData = $this->groupRepos->getMetaFields($journal->id, $this->metaFields);
$metaDates = $this->getDates($this->groupRepos->getMetaDateFields($journal->id, $this->metaDateFields));
$foreignCurrency = $this->getForeignCurrency($source->foreignCurrency);
@@ -321,7 +321,7 @@ class TransactionGroupTransformer extends AbstractTransformer
return [
'user' => $journal->user_id,
'transaction_journal_id' => (string) $journal->id,
'type' => strtolower($type),
'type' => strtolower((string) $type),
'date' => $journal->date->toAtomString(),
'order' => $journal->order,