Various code cleanup.

This commit is contained in:
James Cole
2021-04-07 07:28:43 +02:00
parent 4ddcb0c965
commit f12744ad8c
180 changed files with 714 additions and 721 deletions

View File

@@ -76,18 +76,18 @@ class OperationsController extends Controller
$cache->addProperty('expense-report');
$cache->addProperty($accounts->pluck('id')->toArray());
if ($cache->has()) {
return $cache->get(); // @codeCoverageIgnore
return $cache->get();
}
$report = $this->tasker->getExpenseReport($start, $end, $accounts);
$type = 'expense-entry';
try {
$result = prefixView('reports.partials.income-expenses', compact('report', 'type'))->render();
// @codeCoverageIgnoreStart
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render reports.partials.income-expense: %s', $e->getMessage()));
$result = 'Could not render view.';
}
// @codeCoverageIgnoreEnd
$cache->store($result);
return $result;
@@ -111,18 +111,18 @@ class OperationsController extends Controller
$cache->addProperty('income-report');
$cache->addProperty($accounts->pluck('id')->toArray());
if ($cache->has()) {
return $cache->get(); // @codeCoverageIgnore
return $cache->get();
}
$report = $this->tasker->getIncomeReport($start, $end, $accounts);
$type = 'income-entry';
try {
$result = prefixView('reports.partials.income-expenses', compact('report', 'type'))->render();
// @codeCoverageIgnoreStart
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render reports.partials.income-expenses: %s', $e->getMessage()));
$result = 'Could not render view.';
}
// @codeCoverageIgnoreEnd
$cache->store($result);
return $result;
@@ -146,7 +146,7 @@ class OperationsController extends Controller
$cache->addProperty('inc-exp-report');
$cache->addProperty($accounts->pluck('id')->toArray());
if ($cache->has()) {
return $cache->get(); // @codeCoverageIgnore
return $cache->get();
}
$incomes = $this->tasker->getIncomeReport($start, $end, $accounts);
@@ -172,7 +172,7 @@ class OperationsController extends Controller
try {
$result = prefixView('reports.partials.operations', compact('sums'))->render();
} catch (Throwable $e) {
} catch (Throwable $e) { // @phpstan-ignore-line
Log::debug(sprintf('Could not render reports.partials.operations: %s', $e->getMessage()));
$result = 'Could not render view.';
}