mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 14:48:11 +00:00
Code cleanup.
This commit is contained in:
@@ -75,11 +75,7 @@ class AccountController extends Controller
|
||||
return $next($request);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shows the balances for all the user's expense accounts (on the front page).
|
||||
*
|
||||
@@ -333,8 +329,6 @@ class AccountController extends Controller
|
||||
$defaultSet = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])->pluck('id')->toArray();
|
||||
Log::debug('Default set is ', $defaultSet);
|
||||
$frontPage = app('preferences')->get('frontPageAccounts', $defaultSet);
|
||||
|
||||
|
||||
Log::debug('Frontpage preference set is ', $frontPage->data);
|
||||
if (0 === count($frontPage->data)) {
|
||||
app('preferences')->set('frontPageAccounts', $defaultSet);
|
||||
@@ -471,8 +465,6 @@ class AccountController extends Controller
|
||||
{
|
||||
return response()->json($this->accountBalanceChart($accounts, $start, $end));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shows the balances for all the user's revenue accounts.
|
||||
*
|
||||
|
||||
@@ -50,8 +50,6 @@ class BillController extends Controller
|
||||
parent::__construct();
|
||||
$this->generator = app(GeneratorInterface::class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shows all bills and whether or not they've been paid this month (pie chart).
|
||||
*
|
||||
@@ -94,8 +92,6 @@ class BillController extends Controller
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shows overview for a single bill.
|
||||
*
|
||||
|
||||
@@ -77,8 +77,6 @@ class BudgetController extends Controller
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shows overview of a single budget.
|
||||
*
|
||||
@@ -143,8 +141,6 @@ class BudgetController extends Controller
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shows the amount left in a specific budget limit.
|
||||
*
|
||||
@@ -196,8 +192,6 @@ class BudgetController extends Controller
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shows how much is spent per asset account.
|
||||
*
|
||||
@@ -265,8 +259,6 @@ class BudgetController extends Controller
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shows how much is spent per category.
|
||||
*
|
||||
@@ -330,8 +322,6 @@ class BudgetController extends Controller
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shows how much is spent per expense account.
|
||||
*
|
||||
@@ -398,8 +388,6 @@ class BudgetController extends Controller
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shows a budget list with spent/left/overspent.
|
||||
*
|
||||
@@ -431,8 +419,6 @@ class BudgetController extends Controller
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shows a budget overview chart (spent and budgeted).
|
||||
*
|
||||
@@ -508,8 +494,6 @@ class BudgetController extends Controller
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shows a chart for transactions without a budget.
|
||||
*
|
||||
|
||||
@@ -60,8 +60,6 @@ class CategoryController extends Controller
|
||||
// create chart generator:
|
||||
$this->generator = app(GeneratorInterface::class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show an overview for a category for all time, per month/week/year.
|
||||
* TODO test method, for category refactor.
|
||||
@@ -94,8 +92,6 @@ class CategoryController extends Controller
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Shows the category chart on the front page.
|
||||
* TODO test method, for category refactor.
|
||||
@@ -116,8 +112,6 @@ class CategoryController extends Controller
|
||||
}
|
||||
|
||||
$frontPageGenerator = new FrontpageChartGenerator($start, $end);
|
||||
|
||||
|
||||
$chartData = $frontPageGenerator->generate();
|
||||
$data = $this->generator->multiSet($chartData);
|
||||
$cache->store($data);
|
||||
@@ -153,8 +147,6 @@ class CategoryController extends Controller
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Chart for period for transactions without a category.
|
||||
* TODO test me.
|
||||
@@ -205,8 +197,6 @@ class CategoryController extends Controller
|
||||
$cache->addProperty($end);
|
||||
$cache->addProperty($category->id);
|
||||
$cache->addProperty('chart.category.period-chart');
|
||||
|
||||
|
||||
if ($cache->has()) {
|
||||
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||
}
|
||||
@@ -295,8 +285,6 @@ class CategoryController extends Controller
|
||||
'type' => 'bar',
|
||||
'backgroundColor' => 'rgba(0, 141, 76, 0.5)', // green
|
||||
];
|
||||
|
||||
|
||||
// loop empty periods:
|
||||
foreach (array_keys($periods) as $period) {
|
||||
$label = $periods[$period];
|
||||
|
||||
@@ -247,8 +247,6 @@ class DoubleReportController extends Controller
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Collection $accounts
|
||||
* @param Collection $others
|
||||
|
||||
@@ -64,8 +64,6 @@ class ExpenseReportController extends Controller
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Main chart that shows income and expense for a combination of expense/revenue accounts.
|
||||
*
|
||||
|
||||
@@ -171,8 +171,6 @@ class TagReportController extends Controller
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Collection $accounts
|
||||
* @param Collection $tags
|
||||
@@ -427,8 +425,6 @@ class TagReportController extends Controller
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Collection $accounts
|
||||
* @param Collection $tags
|
||||
@@ -462,8 +458,6 @@ class TagReportController extends Controller
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO duplicate function
|
||||
*
|
||||
|
||||
@@ -68,8 +68,6 @@ class TransactionController extends Controller
|
||||
if ($cache->has()) {
|
||||
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
$collector->setRange($start, $end);
|
||||
@@ -115,8 +113,6 @@ class TransactionController extends Controller
|
||||
if ($cache->has()) {
|
||||
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
$collector->setRange($start, $end);
|
||||
@@ -175,8 +171,6 @@ class TransactionController extends Controller
|
||||
if ($cache->has()) {
|
||||
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
$collector->setRange($start, $end);
|
||||
@@ -234,8 +228,6 @@ class TransactionController extends Controller
|
||||
if ($cache->has()) {
|
||||
return response()->json($cache->get()); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
$collector->setRange($start, $end);
|
||||
|
||||
Reference in New Issue
Block a user