Remove static references

This commit is contained in:
James Cole
2023-10-29 06:32:00 +01:00
parent e65d0eef6e
commit 075d459b7c
128 changed files with 391 additions and 391 deletions

View File

@@ -116,7 +116,7 @@ class DecryptDatabase extends Command
try {
$configVar = app('fireflyconfig')->get($configName, false);
} catch (FireflyException $e) {
Log::error($e->getMessage());
app('log')->error($e->getMessage());
}
if (null !== $configVar) {
return (bool)$configVar->data;
@@ -157,8 +157,8 @@ class DecryptDatabase extends Command
} catch (FireflyException $e) {
$message = sprintf('Could not decrypt field "%s" in row #%d of table "%s": %s', $field, $id, $table, $e->getMessage());
$this->friendlyError($message);
Log::error($message);
Log::error($e->getTraceAsString());
app('log')->error($message);
app('log')->error($e->getTraceAsString());
}
// A separate routine for preferences table:

View File

@@ -171,7 +171,7 @@ class TransactionIdentifier extends Command
->whereNotIn('id', $exclude)
->first();
} catch (QueryException $e) {
Log::error($e->getMessage());
app('log')->error($e->getMessage());
$this->friendlyError('Firefly III could not find the "identifier" field in the "transactions" table.');
$this->friendlyError(sprintf('This field is required for Firefly III version %s to run.', config('firefly.version')));
$this->friendlyError('Please run "php artisan migrate" to add this field to the table.');

View File

@@ -319,7 +319,7 @@ class TransferCurrenciesCorrections extends Command
// source account must have a currency preference.
if (null === $this->sourceCurrency) {
$message = sprintf('Account #%d ("%s") must have currency preference but has none.', $this->sourceAccount->id, $this->sourceAccount->name);
Log::error($message);
app('log')->error($message);
$this->friendlyError($message);
return true;
@@ -332,7 +332,7 @@ class TransferCurrenciesCorrections extends Command
$this->destinationAccount->id,
$this->destinationAccount->name
);
Log::error($message);
app('log')->error($message);
$this->friendlyError($message);
return true;