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

@@ -264,7 +264,7 @@ trait AccountCollection
$date->subSecond();
Log::debug(sprintf('accountBalanceIs: Call finalAccountBalance with date/time "%s"', $date->toIso8601String()));
$balance = Steam::finalAccountBalance($account, $date);
$result = bccomp($balance['balance'], $value);
$result = bccomp((string) $balance['balance'], $value);
Log::debug(sprintf('"%s" vs "%s" is %d', $balance['balance'], $value, $result));
switch ($operator) {

View File

@@ -51,8 +51,8 @@ trait AttachmentCollection
foreach ($object['transactions'] as $transaction) {
/** @var array $attachment */
foreach ($transaction['attachments'] as $attachment) {
$result = str_contains(strtolower($attachment['filename']), strtolower($name)) || str_contains(
strtolower($attachment['title']),
$result = str_contains(strtolower((string) $attachment['filename']), strtolower($name)) || str_contains(
strtolower((string) $attachment['title']),
strtolower($name)
);
if (true === $result) {
@@ -131,8 +131,8 @@ trait AttachmentCollection
foreach ($object['transactions'] as $transaction) {
/** @var array $attachment */
foreach ($transaction['attachments'] as $attachment) {
$result = !str_contains(strtolower($attachment['filename']), strtolower($name)) && !str_contains(
strtolower($attachment['title']),
$result = !str_contains(strtolower((string) $attachment['filename']), strtolower($name)) && !str_contains(
strtolower((string) $attachment['title']),
strtolower($name)
);
if (true === $result) {
@@ -166,8 +166,8 @@ trait AttachmentCollection
foreach ($object['transactions'] as $transaction) {
/** @var array $attachment */
foreach ($transaction['attachments'] as $attachment) {
$result = !str_ends_with(strtolower($attachment['filename']), strtolower($name)) && !str_ends_with(
strtolower($attachment['title']),
$result = !str_ends_with(strtolower((string) $attachment['filename']), strtolower($name)) && !str_ends_with(
strtolower((string) $attachment['title']),
strtolower($name)
);
if (true === $result) {
@@ -201,8 +201,8 @@ trait AttachmentCollection
foreach ($object['transactions'] as $transaction) {
/** @var array $attachment */
foreach ($transaction['attachments'] as $attachment) {
$result = !str_starts_with(strtolower($attachment['filename']), strtolower($name)) && !str_starts_with(
strtolower($attachment['title']),
$result = !str_starts_with(strtolower((string) $attachment['filename']), strtolower($name)) && !str_starts_with(
strtolower((string) $attachment['title']),
strtolower($name)
);
if (true === $result) {
@@ -227,8 +227,8 @@ trait AttachmentCollection
foreach ($object['transactions'] as $transaction) {
/** @var array $attachment */
foreach ($transaction['attachments'] as $attachment) {
$result = str_ends_with(strtolower($attachment['filename']), strtolower($name)) || str_ends_with(
strtolower($attachment['title']),
$result = str_ends_with(strtolower((string) $attachment['filename']), strtolower($name)) || str_ends_with(
strtolower((string) $attachment['title']),
strtolower($name)
);
if (true === $result) {
@@ -299,8 +299,8 @@ trait AttachmentCollection
foreach ($object['transactions'] as $transaction) {
/** @var array $attachment */
foreach ($transaction['attachments'] as $attachment) {
$result = str_starts_with(strtolower($attachment['filename']), strtolower($name)) || str_starts_with(
strtolower($attachment['title']),
$result = str_starts_with(strtolower((string) $attachment['filename']), strtolower($name)) || str_starts_with(
strtolower((string) $attachment['title']),
strtolower($name)
);
if (true === $result) {

View File

@@ -492,7 +492,7 @@ trait MetaCollection
'notes',
static function (JoinClause $join): void {
$join->on('notes.noteable_id', '=', 'transaction_journals.id');
$join->where('notes.noteable_type', '=', 'FireflyIII\Models\TransactionJournal');
$join->where('notes.noteable_type', '=', \FireflyIII\Models\TransactionJournal::class);
$join->whereNull('notes.deleted_at');
}
);
@@ -601,8 +601,8 @@ trait MetaCollection
return false;
}
foreach ($transaction['tags'] as $tag) {
Log::debug(sprintf('"%s" versus', strtolower($tag['name'])), $list);
if (in_array(strtolower($tag['name']), $list, true)) {
Log::debug(sprintf('"%s" versus', strtolower((string) $tag['name'])), $list);
if (in_array(strtolower((string) $tag['name']), $list, true)) {
app('log')->debug(sprintf('Transaction has tag "%s" so count++.', $tag['name']));
++$foundTagCount;
$journalId = $transaction['transaction_journal_id'];
@@ -779,8 +779,8 @@ trait MetaCollection
Log::debug(sprintf('Now in setTags(%s) filter', implode(', ', $list)));
foreach ($object['transactions'] as $transaction) {
foreach ($transaction['tags'] as $tag) {
Log::debug(sprintf('"%s" versus', strtolower($tag['name'])), $list);
if (in_array(strtolower($tag['name']), $list, true)) {
Log::debug(sprintf('"%s" versus', strtolower((string) $tag['name'])), $list);
if (in_array(strtolower((string) $tag['name']), $list, true)) {
app('log')->debug(sprintf('Transaction has tag "%s" so return true.', $tag['name']));
return true;
@@ -811,8 +811,8 @@ trait MetaCollection
foreach ($object['transactions'] as $transaction) {
app('log')->debug(sprintf('Transaction has %d tag(s)', count($transaction['tags'])));
foreach ($transaction['tags'] as $tag) {
Log::debug(sprintf('"%s" versus', strtolower($tag['name'])), $list);
if (in_array(strtolower($tag['name']), $list, true)) {
Log::debug(sprintf('"%s" versus', strtolower((string) $tag['name'])), $list);
if (in_array(strtolower((string) $tag['name']), $list, true)) {
app('log')->debug(sprintf('Transaction has tag "%s", but should not have it, return false.', $tag['name']));
return false;