mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-20 11:33:59 +00:00
Some generic code refactoring.
This commit is contained in:
@@ -220,7 +220,7 @@ trait GetConfigurationData
|
||||
}, $forbidden
|
||||
);
|
||||
foreach ($list as $entry) {
|
||||
if (\in_array($entry, $trimmed, true)) {
|
||||
if (in_array($entry, $trimmed, true)) {
|
||||
Log::error('Method "%s" is FORBIDDEN, so the console command cannot be executed.');
|
||||
|
||||
return true;
|
||||
|
@@ -474,6 +474,12 @@ trait PeriodOverview
|
||||
$sumCollector = app(GroupSumCollectorInterface::class);
|
||||
$sumCollector->setTypes($types)->setRange($currentDate['start'], $currentDate['end']);
|
||||
$amounts = $sumCollector->getSum();
|
||||
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
$collector->setTypes($types)->setRange($currentDate['start'], $currentDate['end']);
|
||||
$amounts = $collector->getSum();
|
||||
|
||||
$spent = [];
|
||||
$earned = [];
|
||||
$transferred = [];
|
||||
|
@@ -60,7 +60,7 @@ trait RenderPartialViews
|
||||
$set = new Collection;
|
||||
$names = $revenue->pluck('name')->toArray();
|
||||
foreach ($expense as $exp) {
|
||||
if (\in_array($exp->name, $names, true)) {
|
||||
if (in_array($exp->name, $names, true)) {
|
||||
$set->push($exp);
|
||||
}
|
||||
}
|
||||
|
@@ -103,7 +103,7 @@ trait UserNavigation
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($transactions as $transaction) {
|
||||
$account = $transaction->account;
|
||||
if (\in_array($account->accountType->type, $valid, true)) {
|
||||
if (in_array($account->accountType->type, $valid, true)) {
|
||||
return redirect(route('accounts.show', [$account->id]));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user