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

@@ -60,7 +60,7 @@ trait ChartGeneration
if ($cache->has()) {
return $cache->get();
}
Log::debug('Regenerate chart.account.account-balance-chart from scratch.');
app('log')->debug('Regenerate chart.account.account-balance-chart from scratch.');
$locale = app('steam')->getLocale();
/** @var GeneratorInterface $generator */
$generator = app(GeneratorInterface::class);

View File

@@ -80,7 +80,7 @@ trait GetConfigurationData
$steps[] = $currentStep;
}
}
Log::debug(sprintf('Total basic steps for %s is %d', $routeKey, count($steps)));
app('log')->debug(sprintf('Total basic steps for %s is %d', $routeKey, count($steps)));
return $steps;
}
@@ -210,7 +210,7 @@ trait GetConfigurationData
}
}
}
Log::debug(sprintf('Total specific steps for route "%s" and page "%s" (routeKey is "%s") is %d', $route, $specificPage, $routeKey, count($steps)));
app('log')->debug(sprintf('Total specific steps for route "%s" and page "%s" (routeKey is "%s") is %d', $route, $specificPage, $routeKey, count($steps)));
return $steps;
}
@@ -223,7 +223,7 @@ trait GetConfigurationData
$config = app('fireflyconfig')->get('last_rt_job', 0);
$lastTime = (int)$config->data;
$now = time();
Log::debug(sprintf('verifyRecurringCronJob: last time is %d ("%s"), now is %d', $lastTime, $config->data, $now));
app('log')->debug(sprintf('verifyRecurringCronJob: last time is %d ("%s"), now is %d', $lastTime, $config->data, $now));
if (0 === $lastTime) {
request()->session()->flash('info', trans('firefly.recurring_never_cron'));

View File

@@ -147,8 +147,8 @@ trait ModelInformation
]
)->render();
} catch (Throwable $e) {
Log::debug(sprintf('Throwable was thrown in getTriggersForBill(): %s', $e->getMessage()));
Log::debug($e->getTraceAsString());
app('log')->debug(sprintf('Throwable was thrown in getTriggersForBill(): %s', $e->getMessage()));
app('log')->debug($e->getTraceAsString());
$string = '';
throw new FireflyException('Could not render trigger', 0, $e);
}
@@ -263,8 +263,8 @@ trait ModelInformation
]
)->render();
} catch (Throwable $e) {
Log::debug(sprintf('Throwable was thrown in getTriggersForJournal(): %s', $e->getMessage()));
Log::debug($e->getTraceAsString());
app('log')->debug(sprintf('Throwable was thrown in getTriggersForJournal(): %s', $e->getMessage()));
app('log')->debug($e->getTraceAsString());
$string = '';
throw new FireflyException('Could not render trigger', 0, $e);
}

View File

@@ -409,14 +409,14 @@ trait PeriodOverview
*/
protected function getNoCategoryPeriodOverview(Carbon $theDate): array
{
Log::debug(sprintf('Now in getNoCategoryPeriodOverview(%s)', $theDate->format('Y-m-d')));
app('log')->debug(sprintf('Now in getNoCategoryPeriodOverview(%s)', $theDate->format('Y-m-d')));
$range = app('navigation')->getViewRange(true);
$first = $this->journalRepos->firstNull();
$start = null === $first ? new Carbon() : $first->date;
$end = clone $theDate;
Log::debug(sprintf('Start for getNoCategoryPeriodOverview() is %s', $start->format('Y-m-d')));
Log::debug(sprintf('End for getNoCategoryPeriodOverview() is %s', $end->format('Y-m-d')));
app('log')->debug(sprintf('Start for getNoCategoryPeriodOverview() is %s', $start->format('Y-m-d')));
app('log')->debug(sprintf('End for getNoCategoryPeriodOverview() is %s', $end->format('Y-m-d')));
// properties for cache
$dates = app('navigation')->blockPeriods($start, $end, $range);
@@ -462,7 +462,7 @@ trait PeriodOverview
'transferred' => $this->groupByCurrency($transferred),
];
}
Log::debug('End of loops');
app('log')->debug('End of loops');
return $entries;
}

View File

@@ -292,7 +292,7 @@ trait RenderPartialViews
]
)->render();
} catch (Throwable $e) {
Log::debug(sprintf('Throwable was thrown in getCurrentActions(): %s', $e->getMessage()));
app('log')->debug(sprintf('Throwable was thrown in getCurrentActions(): %s', $e->getMessage()));
app('log')->error($e->getTraceAsString());
throw new FireflyException(sprintf('Could not render: %s', $e->getMessage()), 0, $e);
}
@@ -347,7 +347,7 @@ trait RenderPartialViews
]
)->render();
} catch (Throwable $e) {
Log::debug(sprintf('Throwable was thrown in getCurrentTriggers(): %s', $e->getMessage()));
app('log')->debug(sprintf('Throwable was thrown in getCurrentTriggers(): %s', $e->getMessage()));
app('log')->error($e->getTraceAsString());
throw new FireflyException(sprintf('Could not render: %s', $e->getMessage()), 0, $e);
}

View File

@@ -173,7 +173,7 @@ trait RequestInformation
try {
$attributes['startDate'] = Carbon::createFromFormat('Ymd', $attributes['startDate'])->startOfDay();
} catch (InvalidArgumentException $e) {
Log::debug(sprintf('Not important error message: %s', $e->getMessage()));
app('log')->debug(sprintf('Not important error message: %s', $e->getMessage()));
$date = today(config('app.timezone'))->startOfMonth();
$attributes['startDate'] = $date;
}
@@ -181,7 +181,7 @@ trait RequestInformation
try {
$attributes['endDate'] = Carbon::createFromFormat('Ymd', $attributes['endDate'])->endOfDay();
} catch (InvalidArgumentException $e) {
Log::debug(sprintf('Not important error message: %s', $e->getMessage()));
app('log')->debug(sprintf('Not important error message: %s', $e->getMessage()));
$date = today(config('app.timezone'))->startOfMonth();
$attributes['endDate'] = $date;
}

View File

@@ -107,7 +107,7 @@ trait RuleManagement
]
)->render();
} catch (Throwable $e) {
Log::debug(sprintf('Throwable was thrown in getPreviousTriggers(): %s', $e->getMessage()));
app('log')->debug(sprintf('Throwable was thrown in getPreviousTriggers(): %s', $e->getMessage()));
app('log')->error($e->getTraceAsString());
throw new FireflyException(sprintf('Could not render: %s', $e->getMessage()), 0, $e);
}
@@ -152,7 +152,7 @@ trait RuleManagement
]
)->render();
} catch (Throwable $e) {
Log::debug(sprintf('Throwable was thrown in getPreviousTriggers(): %s', $e->getMessage()));
app('log')->debug(sprintf('Throwable was thrown in getPreviousTriggers(): %s', $e->getMessage()));
app('log')->error($e->getTraceAsString());
throw new FireflyException(sprintf('Could not render: %s', $e->getMessage()), 0, $e);
}

View File

@@ -53,9 +53,9 @@ trait UserNavigation
*/
final protected function getPreviousUrl(string $identifier): string
{
Log::debug(sprintf('Trying to retrieve URL stored under "%s"', $identifier));
app('log')->debug(sprintf('Trying to retrieve URL stored under "%s"', $identifier));
$url = (string)session($identifier);
Log::debug(sprintf('The URL is %s', $url));
app('log')->debug(sprintf('The URL is %s', $url));
return app('steam')->getSafeUrl($url, route('index'));
}
@@ -166,7 +166,7 @@ trait UserNavigation
$return = app('steam')->getSafePreviousUrl();
session()->put($identifier, $return);
Log::debug(sprintf('rememberPreviousUrl: %s: "%s"', $identifier, $return));
app('log')->debug(sprintf('rememberPreviousUrl: %s: "%s"', $identifier, $return));
return $return;
}