From 04a2cd1f1fa88556d516c55a1ccd066d274608a5 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 11 Aug 2017 05:42:15 +0200 Subject: [PATCH] Small code cleanup. --- app/Http/Controllers/Auth/RegisterController.php | 2 +- app/Http/Controllers/CategoryController.php | 2 -- app/Http/Controllers/Transaction/SingleController.php | 4 ++-- app/Http/Controllers/TransactionController.php | 2 -- public/js/ff/charts.js | 2 +- public/js/ff/export/index.js | 3 +-- tests/Feature/Controllers/TagControllerTest.php | 1 - tests/Unit/Helpers/MetaPieChartTest.php | 7 ++----- 8 files changed, 7 insertions(+), 16 deletions(-) diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 6d2822d398..b91b436c0c 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -53,7 +53,7 @@ class RegisterController extends Controller } /** - * @param Request $request + * @param UserRegistrationRequest|Request $request * * @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View */ diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index a4592a5ce0..240e2e18ed 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -227,8 +227,6 @@ class CategoryController extends Controller $subTitleIcon = 'fa-bar-chart'; $page = intval($request->get('page')); $pageSize = intval(Preferences::get('transactionPageSize', 50)->data); - $count = 0; - $loop = 0; $range = Preferences::get('viewRange', '1M')->data; $start = null; $end = null; diff --git a/app/Http/Controllers/Transaction/SingleController.php b/app/Http/Controllers/Transaction/SingleController.php index b3e23c25a8..b8baff5568 100644 --- a/app/Http/Controllers/Transaction/SingleController.php +++ b/app/Http/Controllers/Transaction/SingleController.php @@ -199,10 +199,10 @@ class SingleController extends Controller } /** - * @param JournalRepositoryInterface $repository - * @param TransactionJournal $transactionJournal + * @param TransactionJournal $transactionJournal * * @return \Illuminate\Http\RedirectResponse + * @internal param JournalRepositoryInterface $repository */ public function destroy(TransactionJournal $transactionJournal) { diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index 1dcf3fe2de..059a1e3fb7 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -72,8 +72,6 @@ class TransactionController extends Controller $types = config('firefly.transactionTypesByWhat.' . $what); $page = intval($request->get('page')); $pageSize = intval(Preferences::get('transactionPageSize', 50)->data); - $count = 0; - $loop = 0; $range = Preferences::get('viewRange', '1M')->data; $start = null; $end = null; diff --git a/public/js/ff/charts.js b/public/js/ff/charts.js index 9e545d8f57..5ef0380c10 100644 --- a/public/js/ff/charts.js +++ b/public/js/ff/charts.js @@ -7,7 +7,7 @@ * * See the LICENSE file for details. */ -/** global: Chart, defaultChartOptions, accounting, defaultPieOptions, noDataForChart, noDataForChart */ +/** global: Chart, defaultChartOptions, accounting, defaultPieOptions, noDataForChart */ var allCharts = {}; /* diff --git a/public/js/ff/export/index.js b/public/js/ff/export/index.js index c04d89f2cc..4dd745a078 100644 --- a/public/js/ff/export/index.js +++ b/public/js/ff/export/index.js @@ -78,8 +78,7 @@ function showDownload() { function showError(text) { "use strict"; - $('#export-error').show(); - $('#export-error').find('p').text(text); + $('#export-error').show().find('p').text(text); } function callExport() { diff --git a/tests/Feature/Controllers/TagControllerTest.php b/tests/Feature/Controllers/TagControllerTest.php index 83f33af1c5..bb8ac8fecd 100644 --- a/tests/Feature/Controllers/TagControllerTest.php +++ b/tests/Feature/Controllers/TagControllerTest.php @@ -83,7 +83,6 @@ class TagControllerTest extends TestCase public function testEdit() { // mock stuff - $repository = $this->mock(TagRepositoryInterface::class); $journalRepos = $this->mock(JournalRepositoryInterface::class); $journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal); diff --git a/tests/Unit/Helpers/MetaPieChartTest.php b/tests/Unit/Helpers/MetaPieChartTest.php index 02286b0654..e575db4ed3 100644 --- a/tests/Unit/Helpers/MetaPieChartTest.php +++ b/tests/Unit/Helpers/MetaPieChartTest.php @@ -22,9 +22,6 @@ use FireflyIII\Models\Account; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionType; use FireflyIII\Repositories\Account\AccountRepositoryInterface; -use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; -use FireflyIII\Repositories\Category\CategoryRepositoryInterface; -use FireflyIII\Repositories\Tag\TagRepositoryInterface; use Illuminate\Support\Collection; use Tests\TestCase; @@ -62,7 +59,7 @@ class MetaPieChartTest extends TestCase $collector->shouldReceive('getJournals')->andReturn($collection); // mock all repositories: - $accountRepos = $this->mock(AccountRepositoryInterface::class); + $accountRepos = $this->mock(AccountRepositoryInterface::class); $accountRepos->shouldReceive('setUser'); $accountRepos->shouldReceive('find')->withArgs([1])->andReturn($accounts[1]); @@ -122,7 +119,7 @@ class MetaPieChartTest extends TestCase $collector->shouldReceive('getJournals')->andReturn($others)->once(); // mock all repositories: - $accountRepos = $this->mock(AccountRepositoryInterface::class); + $accountRepos = $this->mock(AccountRepositoryInterface::class); $accountRepos->shouldReceive('setUser'); $accountRepos->shouldReceive('find')->withArgs([1])->andReturn($accounts[1]);