From 546787802d1411acb63da0813190e51195e4b0a6 Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 2 Jun 2015 17:14:03 +0200 Subject: [PATCH] Some code cleanup [skip ci] --- app/Http/Controllers/Chart/AccountController.php | 1 + app/Http/Controllers/Chart/BudgetController.php | 4 ++++ app/Http/Controllers/HomeController.php | 12 ++++++------ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index 645867c445..204f99c03f 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -103,6 +103,7 @@ class AccountController extends Controller $chartProperties->addProperty($start); $chartProperties->addProperty($end); $chartProperties->addProperty('frontpage'); + $chartProperties->addProperty('accounts'); /** @var Account $account */ foreach($accounts as $account) { diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index 12c1f9e476..81f7229603 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -2,11 +2,13 @@ namespace FireflyIII\Http\Controllers\Chart; +use Auth; use Carbon\Carbon; use FireflyIII\Http\Controllers\Controller; use FireflyIII\Models\Budget; use FireflyIII\Models\LimitRepetition; use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; +use FireflyIII\Support\ChartProperties; use Grumpydictator\Gchart\GChart; use Illuminate\Support\Collection; use Navigation; @@ -112,6 +114,8 @@ class BudgetController extends Controller $end = Session::get('end', Carbon::now()->endOfMonth()); $allEntries = new Collection; + + /** @var Budget $budget */ foreach ($budgets as $budget) { $repetitions = $repository->getBudgetLimitRepetitions($budget, $start, $end); if ($repetitions->count() == 0) { diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 58d6937b4a..a28ad3acfe 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -46,15 +46,15 @@ class HomeController extends Controller /** * @param AccountRepositoryInterface $repository * - * @return \Illuminate\View\View + * @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View */ public function index(AccountRepositoryInterface $repository) { - $types = Config::get('firefly.accountTypesByIdentifier.asset'); - $count = $repository->countAccounts($types); + $types = Config::get('firefly.accountTypesByIdentifier.asset'); + $count = $repository->countAccounts($types); - if($count == 0) { + if ($count == 0) { return Redirect::route('new-user.index'); } @@ -78,8 +78,8 @@ class HomeController extends Controller if ($sum != 0) { Session::flash( 'error', 'Your transactions are unbalanced. This means a' - . ' withdrawal, deposit or transfer was not stored properly. ' - . 'Please check your accounts and transactions for errors.' + . ' withdrawal, deposit or transfer was not stored properly. ' + . 'Please check your accounts and transactions for errors.' ); }