Replace phpstan suggestions

This commit is contained in:
James Cole
2022-10-30 14:44:49 +01:00
parent c032ffd4f9
commit 33f370359c
45 changed files with 99 additions and 87 deletions

View File

@@ -101,7 +101,7 @@ class CorrectOpeningBalanceCurrencies extends Command
$account = $this->getAccount($journal);
if (null === $account) {
$message = sprintf('Transaction journal #%d has no valid account. Cant fix this line.', $journal->id);
Log::warning($message);
app('log')->warning($message);
$this->warn($message);
return 0;

View File

@@ -68,7 +68,7 @@ class FixUnevenAmount extends Command
if (0 !== bccomp((string)$entry->the_sum, '0')) {
$message = sprintf('Sum of journal #%d is %s instead of zero.', $entry->transaction_journal_id, $entry->the_sum);
$this->warn($message);
Log::warning($message);
app('log')->warning($message);
$this->fixJournal((int)$entry->transaction_journal_id);
$count++;
}

View File

@@ -211,9 +211,9 @@ class DecryptDatabase extends Command
} catch (JsonException $e) {
$message = sprintf('Could not JSON decode preference row #%d: %s. This does not have to be a problem.', $id, $e->getMessage());
$this->error($message);
Log::warning($message);
Log::warning($value);
Log::warning($e->getTraceAsString());
app('log')->warning($message);
app('log')->warning($value);
app('log')->warning($e->getTraceAsString());
return;
}

View File

@@ -80,7 +80,7 @@ class RestoreOAuthKeys extends Command
return;
}
Log::warning('Could not restore keys. Will create new ones.');
app('log')->warning('Could not restore keys. Will create new ones.');
$this->generateKeys();
$this->storeKeysInDB();
$this->line('Generated and stored new keys.');

View File

@@ -111,7 +111,7 @@ class AppendBudgetLimitPeriods extends Command
$limit->end_date->format('Y-m-d')
);
$this->warn($message);
Log::warning($message);
app('log')->warning($message);
return;
}