From 41f200e630d134092d2e5659e704158e308e5065 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 15 Jan 2016 13:08:25 +0100 Subject: [PATCH] Some code cleanup. --- .../Controllers/Chart/CategoryController.php | 6 ++-- app/Http/Controllers/PiggyBankController.php | 2 +- app/Http/Controllers/RuleController.php | 18 ++++++------ app/Http/Controllers/RuleGroupController.php | 28 +++++++++---------- app/Http/Middleware/Binder.php | 5 ++++ 5 files changed, 32 insertions(+), 27 deletions(-) diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index 2314d61c74..028174d80e 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -121,12 +121,12 @@ class CategoryController extends Controller $outside = $repository->sumSpentNoCategory(new Collection, $start, $end); // this is a "fake" entry for the "no category" entry. - $entry = new stdClass(); - $entry->name = trans('firefly.no_category'); + $entry = new stdClass(); + $entry->name = trans('firefly.no_category'); $entry->spent = $outside; $set->push($entry); - $set = $set->sortBy('spent'); + $set = $set->sortBy('spent'); $data = $this->generator->frontpage($set); $cache->store($data); diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index 92ceb4cb88..83ed844119 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -156,7 +156,7 @@ class PiggyBankController extends Controller } /** - * @param ARI $repository + * @param ARI $repository * @param PiggyBankRepositoryInterface $piggyRepository * * @return View diff --git a/app/Http/Controllers/RuleController.php b/app/Http/Controllers/RuleController.php index b9de5fc270..05cf1be3e3 100644 --- a/app/Http/Controllers/RuleController.php +++ b/app/Http/Controllers/RuleController.php @@ -10,11 +10,8 @@ namespace FireflyIII\Http\Controllers; use Auth; -use Config; -use ExpandedForm; use FireflyIII\Http\Requests; use FireflyIII\Http\Requests\RuleFormRequest; -use FireflyIII\Http\Requests\RuleGroupFormRequest; use FireflyIII\Models\Rule; use FireflyIII\Models\RuleAction; use FireflyIII\Models\RuleGroup; @@ -284,14 +281,19 @@ class RuleController extends Controller Session::flash('gaEventCategory', 'rules'); Session::flash('gaEventAction', 'edit-rule'); - return view('rules.rule.edit', compact('rule', 'subTitle', 'primaryTrigger', - 'oldTriggers', 'oldActions', 'triggerCount', 'actionCount')); + return view( + 'rules.rule.edit', compact( + 'rule', 'subTitle', 'primaryTrigger', + 'oldTriggers', 'oldActions', 'triggerCount', 'actionCount' + ) + ); } /** * @param RuleRepositoryInterface $repository * @param RuleFormRequest $request * @param Rule $rule + * * @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector */ public function updateRule(RuleRepositoryInterface $repository, RuleFormRequest $request, Rule $rule) @@ -328,10 +330,10 @@ class RuleController extends Controller } /** - * @param RuleRepositoryInterface $repository - * @param Rule $rule + * @param Rule $rule * * @return View + * @internal param RuleRepositoryInterface $repository */ public function deleteRule(Rule $rule) { @@ -346,8 +348,6 @@ class RuleController extends Controller } - - /** * @param Rule $rule * @param RuleRepositoryInterface $repository diff --git a/app/Http/Controllers/RuleGroupController.php b/app/Http/Controllers/RuleGroupController.php index f11eab8e29..1444da86a8 100644 --- a/app/Http/Controllers/RuleGroupController.php +++ b/app/Http/Controllers/RuleGroupController.php @@ -6,7 +6,6 @@ use Auth; use ExpandedForm; use FireflyIII\Http\Requests\RuleGroupFormRequest; use FireflyIII\Models\RuleGroup; -use FireflyIII\Repositories\Rule\RuleRepositoryInterface; use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface; use Input; use Preferences; @@ -52,8 +51,8 @@ class RuleGroupController extends Controller /** - * @param RuleGroupFormRequest $request - * @param RuleRepositoryInterface $repository + * @param RuleGroupFormRequest $request + * @param RuleGroupRepositoryInterface $repository * * @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector */ @@ -103,9 +102,9 @@ class RuleGroupController extends Controller } /** - * @param RuleGroupFormRequest $request - * @param RuleRepositoryInterface $repository - * @param RuleGroup $ruleGroup + * @param RuleGroupFormRequest $request + * @param RuleGroupRepositoryInterface $repository + * @param RuleGroup $ruleGroup * * @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector */ @@ -135,8 +134,8 @@ class RuleGroupController extends Controller } /** - * @param RuleRepositoryInterface $repository - * @param RuleGroup $ruleGroup + * @param RuleGroupRepositoryInterface $repository + * @param RuleGroup $ruleGroup * * @return View */ @@ -156,8 +155,9 @@ class RuleGroupController extends Controller } /** - * @param RuleGroup $ruleGroup - * @param RuleRepositoryInterface $repository + * @param RuleGroupRepositoryInterface $repository + * + * @param RuleGroup $ruleGroup * * @return \Illuminate\Http\RedirectResponse */ @@ -179,8 +179,8 @@ class RuleGroupController extends Controller /** - * @param RuleRepositoryInterface $repository - * @param RuleGroup $ruleGroup + * @param RuleGroupRepositoryInterface $repository + * @param RuleGroup $ruleGroup * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector */ @@ -193,8 +193,8 @@ class RuleGroupController extends Controller } /** - * @param RuleRepositoryInterface $repository - * @param RuleGroup $ruleGroup + * @param RuleGroupRepositoryInterface $repository + * @param RuleGroup $ruleGroup * * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector */ diff --git a/app/Http/Middleware/Binder.php b/app/Http/Middleware/Binder.php index adb05d03df..088f1e9a8d 100644 --- a/app/Http/Middleware/Binder.php +++ b/app/Http/Middleware/Binder.php @@ -5,6 +5,11 @@ namespace FireflyIII\Http\Middleware; use Closure; use FireflyIII\Support\Domain; +/** + * Class Binder + * + * @package FireflyIII\Http\Middleware + */ class Binder { protected $binders = [];