mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-04 05:06:37 +00:00
Final set of php8.4 changes.
This commit is contained in:
@@ -48,8 +48,8 @@ class CorrectsLongDescriptions extends Command
|
||||
|
||||
/** @var TransactionJournal $journal */
|
||||
foreach ($journals as $journal) {
|
||||
if (strlen($journal->description) > self::MAX_LENGTH) {
|
||||
$journal->description = substr($journal->description, 0, self::MAX_LENGTH);
|
||||
if (strlen((string) $journal->description) > self::MAX_LENGTH) {
|
||||
$journal->description = substr((string) $journal->description, 0, self::MAX_LENGTH);
|
||||
$journal->save();
|
||||
$this->friendlyWarning(sprintf('Truncated description of transaction journal #%d', $journal->id));
|
||||
++$count;
|
||||
@@ -61,7 +61,7 @@ class CorrectsLongDescriptions extends Command
|
||||
/** @var TransactionGroup $group */
|
||||
foreach ($groups as $group) {
|
||||
if (strlen((string) $group->title) > self::MAX_LENGTH) {
|
||||
$group->title = substr($group->title, 0, self::MAX_LENGTH);
|
||||
$group->title = substr((string) $group->title, 0, self::MAX_LENGTH);
|
||||
$group->save();
|
||||
$this->friendlyWarning(sprintf('Truncated description of transaction group #%d', $group->id));
|
||||
++$count;
|
||||
|
||||
@@ -100,7 +100,7 @@ class CorrectsRecurringTransactions extends Command
|
||||
$destination = $transaction->destinationAccount;
|
||||
$type = $recurrence->transactionType;
|
||||
$link = config(sprintf('firefly.account_to_transaction.%s.%s', $source->accountType->type, $destination->accountType->type));
|
||||
if (null !== $link && strtolower($type->type) !== strtolower($link)) {
|
||||
if (null !== $link && strtolower((string) $type->type) !== strtolower($link)) {
|
||||
$this->friendlyWarning(
|
||||
sprintf('Recurring transaction #%d should be a "%s" but is a "%s" and will be corrected.', $recurrence->id, $link, $type->type)
|
||||
);
|
||||
|
||||
@@ -184,7 +184,7 @@ class CorrectsUnevenAmount extends Command
|
||||
return;
|
||||
}
|
||||
|
||||
$amount = bcmul('-1', $source->amount);
|
||||
$amount = bcmul('-1', (string) $source->amount);
|
||||
|
||||
// fix amount of destination:
|
||||
/** @var null|Transaction $destination */
|
||||
@@ -249,9 +249,9 @@ class CorrectsUnevenAmount extends Command
|
||||
// Log::debug(sprintf('[c] %s', var_export($source->transaction_currency_id === $destination->foreign_currency_id,true)));
|
||||
// Log::debug(sprintf('[d] %s', var_export((int) $destination->transaction_currency_id ===(int) $source->foreign_currency_id, true)));
|
||||
|
||||
if (0 === bccomp(app('steam')->positive($source->amount), app('steam')->positive($destination->foreign_amount))
|
||||
if (0 === bccomp((string) app('steam')->positive($source->amount), (string) app('steam')->positive($destination->foreign_amount))
|
||||
&& $source->transaction_currency_id === $destination->foreign_currency_id
|
||||
&& 0 === bccomp(app('steam')->positive($destination->amount), app('steam')->positive($source->foreign_amount))
|
||||
&& 0 === bccomp((string) app('steam')->positive($destination->amount), (string) app('steam')->positive($source->foreign_amount))
|
||||
&& (int) $destination->transaction_currency_id === (int) $source->foreign_currency_id
|
||||
) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user