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

@@ -298,8 +298,8 @@ trait AccountServiceTrait
try {
$group = $factory->create($submission);
} catch (DuplicateTransactionException $e) {
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
app('log')->error($e->getMessage());
app('log')->error($e->getTraceAsString());
throw new FireflyException($e->getMessage(), 0, $e);
}
@@ -543,8 +543,8 @@ trait AccountServiceTrait
try {
$group = $factory->create($submission);
} catch (DuplicateTransactionException $e) {
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
app('log')->error($e->getMessage());
app('log')->error($e->getTraceAsString());
throw new FireflyException($e->getMessage(), 0, $e);
}
@@ -758,8 +758,8 @@ trait AccountServiceTrait
try {
$group = $factory->create($submission);
} catch (DuplicateTransactionException $e) {
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
app('log')->error($e->getMessage());
app('log')->error($e->getTraceAsString());
throw new FireflyException($e->getMessage(), 0, $e);
}

View File

@@ -85,8 +85,8 @@ class CreditRecalculateService
try {
$this->findByJournal($journal);
} catch (FireflyException $e) {
Log::error($e->getTraceAsString());
Log::error(sprintf('Could not find work account for transaction group #%d.', $this->group->id));
app('log')->error($e->getTraceAsString());
app('log')->error(sprintf('Could not find work account for transaction group #%d.', $this->group->id));
}
}
}

View File

@@ -222,7 +222,7 @@ trait RecurringTransactionTrait
try {
$result = $factory->findOrCreate($accountName, $expectedType);
} catch (FireflyException $e) {
Log::error($e->getMessage());
app('log')->error($e->getMessage());
}
}
}

View File

@@ -48,7 +48,7 @@ trait TransactionTypeTrait
$factory = app(TransactionTypeFactory::class);
$transactionType = $factory->find($type);
if (null === $transactionType) {
Log::error(sprintf('Could not find transaction type for "%s"', $type));
app('log')->error(sprintf('Could not find transaction type for "%s"', $type));
throw new FireflyException(sprintf('Could not find transaction type for "%s"', $type));
}

View File

@@ -99,7 +99,7 @@ class GroupUpdateService
Log::debug('Array of updated IDs: ', $updated);
if (0 === count($updated)) {
Log::error('There were no transactions updated or created. Will not delete anything.');
app('log')->error('There were no transactions updated or created. Will not delete anything.');
$transactionGroup->refresh();
app('preferences')->mark();
@@ -197,7 +197,7 @@ class GroupUpdateService
$updated[] = $newJournal->id;
}
if (null === $newJournal) {
Log::error('createTransactionJournal returned NULL, indicating something went wrong.');
app('log')->error('createTransactionJournal returned NULL, indicating something went wrong.');
}
}
if (null !== $journal) {
@@ -234,8 +234,8 @@ class GroupUpdateService
try {
$collection = $factory->create($submission);
} catch (FireflyException $e) {
Log::error($e->getMessage());
Log::error($e->getTraceAsString());
app('log')->error($e->getMessage());
app('log')->error($e->getTraceAsString());
throw new FireflyException(
sprintf('Could not create new transaction journal: %s', $e->getMessage()),
0,

View File

@@ -384,7 +384,7 @@ class JournalUpdateService
try {
$result = $this->getAccount($expectedType, 'source', $sourceInfo);
} catch (FireflyException $e) {
Log::error(sprintf('Cant get the valid source account: %s', $e->getMessage()));
app('log')->error(sprintf('Cant get the valid source account: %s', $e->getMessage()));
$result = $this->getOriginalSourceAccount();
}
@@ -404,7 +404,7 @@ class JournalUpdateService
// cowardly refuse to update if both accounts are the same.
if ($source->id === $destination->id) {
Log::error(sprintf('Source + dest accounts are equal (%d, "%s")', $source->id, $source->name));
app('log')->error(sprintf('Source + dest accounts are equal (%d, "%s")', $source->id, $source->name));
return;
}
@@ -451,7 +451,7 @@ class JournalUpdateService
try {
$result = $this->getAccount($expectedType, 'destination', $destInfo);
} catch (FireflyException $e) {
Log::error(sprintf('getValidDestinationAccount() threw unexpected error: %s', $e->getMessage()));
app('log')->error(sprintf('getValidDestinationAccount() threw unexpected error: %s', $e->getMessage()));
$result = $this->getOriginalDestinationAccount();
}
@@ -766,7 +766,7 @@ class JournalUpdateService
// not the same as normal currency
if (null !== $foreignCurrency && $foreignCurrency->id === $this->transactionJournal->transaction_currency_id) {
Log::error(sprintf('Foreign currency is equal to normal currency (%s)', $foreignCurrency->code));
app('log')->error(sprintf('Foreign currency is equal to normal currency (%s)', $foreignCurrency->code));
return;
}