Remove static references

This commit is contained in:
James Cole
2023-10-29 06:33:43 +01:00
parent 075d459b7c
commit 4f2159b54d
205 changed files with 1287 additions and 1287 deletions

View File

@@ -146,7 +146,7 @@ class BulkController extends Controller
if (true === $ignoreUpdate) {
return false;
}
Log::debug(sprintf('Set budget to %d', $budgetId));
app('log')->debug(sprintf('Set budget to %d', $budgetId));
$this->repository->updateBudget($journal, $budgetId);
return true;
@@ -162,7 +162,7 @@ class BulkController extends Controller
private function updateJournalTags(TransactionJournal $journal, string $action, array $tags): bool
{
if ('do_replace' === $action) {
Log::debug(sprintf('Set tags to %s', implode(',', $tags)));
app('log')->debug(sprintf('Set tags to %s', implode(',', $tags)));
$this->repository->updateTags($journal, $tags);
}
if ('do_append' === $action) {
@@ -186,7 +186,7 @@ class BulkController extends Controller
if (true === $ignoreUpdate) {
return false;
}
Log::debug(sprintf('Set budget to %s', $category));
app('log')->debug(sprintf('Set budget to %s', $category));
$this->repository->updateCategory($journal, $category);
return true;

View File

@@ -119,7 +119,7 @@ class ConvertController extends Controller
];
if ($sourceType->type === $destinationType->type) { // cannot convert to its own type.
Log::debug('This is already a transaction of the expected type..');
app('log')->debug('This is already a transaction of the expected type..');
session()->flash('info', (string)trans('firefly.convert_is_already_type_' . $destinationType->type));
return redirect(route('transactions.show', [$group->id]));

View File

@@ -79,7 +79,7 @@ class DeleteController extends Controller
return $this->redirectGroupToAccount($group);
}
Log::debug(sprintf('Start of delete view for group #%d', $group->id));
app('log')->debug(sprintf('Start of delete view for group #%d', $group->id));
$journal = $group->transactionJournals->first();
if (null === $journal) {
@@ -89,7 +89,7 @@ class DeleteController extends Controller
$subTitle = (string)trans('firefly.delete_' . $objectType, ['description' => $group->title ?? $journal->description]);
$previous = app('steam')->getSafePreviousUrl();
// put previous url in session
Log::debug('Will try to remember previous URL');
app('log')->debug('Will try to remember previous URL');
$this->rememberPreviousUrl('transactions.delete.url');
return view('transactions.delete', compact('group', 'journal', 'subTitle', 'objectType', 'previous'));
@@ -104,7 +104,7 @@ class DeleteController extends Controller
*/
public function destroy(TransactionGroup $group): RedirectResponse
{
Log::debug(sprintf('Now in %s(#%d).', __METHOD__, $group->id));
app('log')->debug(sprintf('Now in %s(#%d).', __METHOD__, $group->id));
if (!$this->isEditableGroup($group)) {
return $this->redirectGroupToAccount($group);
}
@@ -134,7 +134,7 @@ class DeleteController extends Controller
/** @var Account $account */
foreach ($accounts as $account) {
Log::debug(sprintf('Now going to trigger updated account event for account #%d', $account->id));
app('log')->debug(sprintf('Now going to trigger updated account event for account #%d', $account->id));
event(new UpdatedAccount($account));
}
app('preferences')->mark();

View File

@@ -123,7 +123,7 @@ class LinkController extends Controller
{
$linkInfo = $request->getLinkInfo();
Log::debug('We are here (store)');
app('log')->debug('We are here (store)');
$other = $this->journalRepository->find($linkInfo['transaction_journal_id']);
if (null === $other) {
session()->flash('error', (string)trans('firefly.invalid_link_selection'));
@@ -144,7 +144,7 @@ class LinkController extends Controller
return redirect(route('transactions.show', [$journal->transaction_group_id]));
}
Log::debug(sprintf('Journal is %d, opposing is %d', $journal->id, $other->id));
app('log')->debug(sprintf('Journal is %d, opposing is %d', $journal->id, $other->id));
$this->repository->storeLink($linkInfo, $other, $journal);
session()->flash('success', (string)trans('firefly.journals_linked'));

View File

@@ -98,23 +98,23 @@ class MassController extends Controller
*/
public function destroy(MassDeleteJournalRequest $request)
{
Log::debug(sprintf('Now in %s', __METHOD__));
app('log')->debug(sprintf('Now in %s', __METHOD__));
$ids = $request->get('confirm_mass_delete');
$count = 0;
if (is_array($ids)) {
Log::debug('Array of IDs', $ids);
app('log')->debug('Array of IDs', $ids);
/** @var string $journalId */
foreach ($ids as $journalId) {
Log::debug(sprintf('Searching for ID #%d', $journalId));
app('log')->debug(sprintf('Searching for ID #%d', $journalId));
/** @var TransactionJournal $journal */
$journal = $this->repository->find((int)$journalId);
if (null !== $journal && (int)$journalId === (int)$journal->id) {
$this->repository->destroyJournal($journal);
++$count;
Log::debug(sprintf('Deleted transaction journal #%d', $journalId));
app('log')->debug(sprintf('Deleted transaction journal #%d', $journalId));
continue;
}
Log::debug(sprintf('Could not find transaction journal #%d', $journalId));
app('log')->debug(sprintf('Could not find transaction journal #%d', $journalId));
}
}
app('preferences')->mark();
@@ -224,7 +224,7 @@ class MassController extends Controller
'amount' => $this->getStringFromRequest($request, $journal->id, 'amount'),
'foreign_amount' => $this->getStringFromRequest($request, $journal->id, 'foreign_amount'),
];
Log::debug(sprintf('Will update journal #%d with data.', $journal->id), $data);
app('log')->debug(sprintf('Will update journal #%d with data.', $journal->id), $data);
// call service to update.
$service->setData($data);