Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Some code cleanup [skip ci]
James Cole3c3b72391355
diff --git a/app/Helpers/Collection/BudgetLine.php b/app/Helpers/Collection/BudgetLine.phpindex b8f76488a1..f26950f9f9 100644--- a/app/Helpers/Collection/BudgetLine.php+++ b/app/Helpers/Collection/BudgetLine.php@@ -17,16 +17,14 @@ class BudgetLine/** @var BudgetModel */protected $budget;-- /** @var LimitRepetition */- protected $repetition;-/** @var float */protected $budgeted = 0;/** @var float */protected $left = 0;/** @var float */protected $overspent = 0;+ /** @var LimitRepetition */+ protected $repetition;/** @var float */protected $spent = 0;@@ -95,35 +93,35 @@ class BudgetLine}/**- * @return float+ * @return LimitRepetition*/- public function getSpent()+ public function getRepetition(){- return $this->spent;+ return $this->repetition;}/**- * @param float $spent+ * @param LimitRepetition $repetition*/- public function setSpent($spent)+ public function setRepetition($repetition){- $this->spent = $spent;+ $this->repetition = $repetition;}/**- * @return LimitRepetition+ * @return float*/- public function getRepetition()+ public function getSpent(){- return $this->repetition;+ return $this->spent;}/**- * @param LimitRepetition $repetition+ * @param float $spent*/- public function setRepetition($repetition)+ public function setSpent($spent){- $this->repetition = $repetition;+ $this->spent = $spent;}diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.phpindex ce160a0d88..88d69cc294 100644--- a/app/Helpers/Report/ReportHelper.php+++ b/app/Helpers/Report/ReportHelper.php@@ -34,6 +34,7 @@ class ReportHelper implements ReportHelperInterface/*** @codeCoverageIgnore+ ** @param ReportQueryInterface $query**/@@ -64,11 +65,13 @@ class ReportHelper implements ReportHelperInterface$diff = 0;// remove cash account, if any:- $accounts =$accounts->filter(function(Account $account) {- if($account->accountType->type != 'Cash account') {- return $account;+ $accounts = $accounts->filter(+ function (Account $account) {+ if ($account->accountType->type != 'Cash account') {+ return $account;+ }}- });+ );// summarize:foreach ($accounts as $account) {diff --git a/app/Helpers/Report/ReportQuery.php b/app/Helpers/Report/ReportQuery.phpindex 990f6aef30..8675989368 100644--- a/app/Helpers/Report/ReportQuery.php+++ b/app/Helpers/Report/ReportQuery.php@@ -5,12 +5,10 @@ namespace FireflyIII\Helpers\Report;use Auth;use Carbon\Carbon;use Crypt;-use DB;use FireflyIII\Models\Account;use FireflyIII\Models\Budget;use FireflyIII\Models\TransactionJournal;use Illuminate\Database\Eloquent\Builder;-use Illuminate\Database\Eloquent\Model;use Illuminate\Database\Query\JoinClause;use Illuminate\Support\Collection;use Steam;@@ -138,7 +136,6 @@ class ReportQuery implements ReportQueryInterface* This method returns all "income" journals in a certain period, which are both transfers from a shared account* and "ordinary" deposits. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does* not group and returns different fields.-** @param Carbon $start* @param Carbon $end@@ -241,7 +238,8 @@ class ReportQuery implements ReportQueryInterface->where('transactions.account_id', $account->id)->before($end)->after($start)- ->whereNull('budget_transaction_journal.budget_id')->get(['transaction_journals.*'])->sum('amount'));+ ->whereNull('budget_transaction_journal.budget_id')->get(['transaction_journals.*'])->sum('amount')+ );}/**diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.phpindex 289eec2ca5..8f575043e4 100644--- a/app/Http/breadcrumbs.php+++ b/app/Http/breadcrumbs.php@@ -1,7 +1,6 @@<?phpuse Carbon\Carbon;use DaveJamesMiller\Breadcrumbs\Generator;-use FireflyIII\Exceptions\FireflyException;use FireflyIII\Models\Account;use FireflyIII\Models\Bill;use FireflyIII\Models\Budget;@@ -71,7 +70,7 @@ Breadcrumbs::register($breadcrumbs->parent('accounts.show', $account);$what = Config::get('firefly.shortNamesByFullName.' . $account->accountType->type);- $breadcrumbs->push(trans('breadcrumbs.edit_'.$what.'_account', ['name' => e($account->name)]), route('accounts.edit', $account->id));+ $breadcrumbs->push(trans('breadcrumbs.edit_' . $what . '_account', ['name' => e($account->name)]), route('accounts.edit', $account->id));});diff --git a/app/Http/routes.php b/app/Http/routes.phpindex 3f1f2066cf..9cff899bab 100644--- a/app/Http/routes.php+++ b/app/Http/routes.php@@ -199,7 +199,7 @@ Route::controllers(*/Route::group(['middleware' => ['auth', 'range', 'reminders', 'piggybanks']], function () {- Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index','middleware' => 'cleanup']);+ Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index', 'middleware' => 'cleanup']);Route::get('/home', ['uses' => 'HomeController@index', 'as' => 'home']);Route::post('/daterange', ['uses' => 'HomeController@dateRange', 'as' => 'daterange']);Route::get('/flush', ['uses' => 'HomeController@flush', 'as' => 'flush']);diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.phpindex 1a0b4f0823..98dd165042 100644--- a/app/Repositories/Budget/BudgetRepository.php+++ b/app/Repositories/Budget/BudgetRepository.php@@ -310,7 +310,6 @@ class BudgetRepository implements BudgetRepositoryInterface}-/*** @param Budget $budget* @param array $datadiff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.phpindex a6c7de1d3c..ed4ed70654 100644--- a/app/Repositories/Category/CategoryRepository.php+++ b/app/Repositories/Category/CategoryRepository.php@@ -5,7 +5,6 @@ namespace FireflyIII\Repositories\Category;use Auth;use Carbon\Carbon;use Crypt;-use DB;use FireflyIII\Models\Category;use FireflyIII\Models\TransactionJournal;use Illuminate\Database\Query\JoinClause;diff --git a/resources/twig/budgets/income.twig b/resources/twig/budgets/income.twigindex fa89e27828..12cc983ae0 100644--- a/resources/twig/budgets/income.twig+++ b/resources/twig/budgets/income.twig@@ -18,4 +18,4 @@</div></form></div>-</div>\ No newline at end of file+</div>