Consistent overview for #1292

This commit is contained in:
James Cole
2018-03-25 21:16:46 +02:00
parent 5f08790f12
commit dd5d2d1616
3 changed files with 21 additions and 10 deletions

View File

@@ -78,6 +78,7 @@ class BudgetController extends Controller
* @param Budget $budget
*
* @return \Illuminate\Http\JsonResponse
* @throws \InvalidArgumentException
*/
public function amount(Request $request, BudgetRepositoryInterface $repository, Budget $budget)
{
@@ -141,6 +142,7 @@ class BudgetController extends Controller
* @param Request $request
*
* @return View
* @throws \RuntimeException
*/
public function create(Request $request)
{
@@ -174,6 +176,7 @@ class BudgetController extends Controller
* @param Budget $budget
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws \RuntimeException
*/
public function destroy(Request $request, Budget $budget)
{
@@ -190,6 +193,7 @@ class BudgetController extends Controller
* @param Budget $budget
*
* @return View
* @throws \RuntimeException
*/
public function edit(Request $request, Budget $budget)
{
@@ -222,12 +226,13 @@ class BudgetController extends Controller
$pageSize = intval(Preferences::get('listPageSize', 50)->data);
// make date if present:
if (null !== $moment || 0 !== strlen(strval($moment))) {
if (null !== $moment || '' !== (string)$moment) {
try {
$start = new Carbon($moment);
$end = app('navigation')->endOfPeriod($start, $range);
} catch (Exception $e) {
// start and end are already defined.
Log::debug('start and end are already defined.');
}
}
$next = clone $end;
@@ -330,7 +335,7 @@ class BudgetController extends Controller
// @codeCoverageIgnoreStart
$result = $cache->get();
return view('budgets.info', compact('result', 'begin', 'currentEnd'));
return view('budgets.info', compact('result'));
// @codeCoverageIgnoreEnd
}
$result = [
@@ -451,6 +456,7 @@ class BudgetController extends Controller
* @param BudgetIncomeRequest $request
*
* @return \Illuminate\Http\RedirectResponse
* @throws \InvalidArgumentException
*/
public function postUpdateIncome(BudgetIncomeRequest $request)
{
@@ -471,14 +477,15 @@ class BudgetController extends Controller
* @param Budget $budget
*
* @return View
* @throws \InvalidArgumentException
*/
public function show(Request $request, Budget $budget)
{
/** @var Carbon $start */
$start = session('first', Carbon::create()->startOfYear());
$end = new Carbon;
$page = intval($request->get('page'));
$pageSize = intval(Preferences::get('listPageSize', 50)->data);
$page = (int)$request->get('page');
$pageSize = (int)Preferences::get('listPageSize', 50)->data;
$limits = $this->getLimits($budget, $start, $end);
$repetition = null;
@@ -501,6 +508,7 @@ class BudgetController extends Controller
*
* @return View
*
* @throws \InvalidArgumentException
* @throws FireflyException
*/
public function showByBudgetLimit(Request $request, Budget $budget, BudgetLimit $budgetLimit)
@@ -538,6 +546,7 @@ class BudgetController extends Controller
* @param BudgetFormRequest $request
*
* @return \Illuminate\Http\RedirectResponse
* @throws \RuntimeException
*/
public function store(BudgetFormRequest $request)
{
@@ -563,6 +572,7 @@ class BudgetController extends Controller
* @param Budget $budget
*
* @return \Illuminate\Http\RedirectResponse
* @throws \RuntimeException
*/
public function update(BudgetFormRequest $request, Budget $budget)
{