Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Some cleaning up courtesy of PHPStorm.
James Cole7bf75128a86b
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.phpindex 488b36c74f..4cc39c0df9 100755--- a/app/Console/Kernel.php+++ b/app/Console/Kernel.php@@ -24,13 +24,15 @@ class Kernel extends ConsoleKernel** @var array*/- protected $commands = [- ];+ protected $commands+ = [+ ];/*** Define the application's command schedule.*- * @param \Illuminate\Console\Scheduling\Schedule $schedule+ * @param \Illuminate\Console\Scheduling\Schedule $schedule+ ** @return void** @SuppressWarnings(PHPMD.UnusedFormalParameters)diff --git a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.phpindex 879a1f8d84..ff1c9b6150 100644--- a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php+++ b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php@@ -35,7 +35,7 @@ class ChartJsBillChartGenerator implements BillChartGenerator'color' => 'rgba(0, 141, 76, 0.7)','highlight' => 'rgba(0, 141, 76, 0.9)','label' => trans('firefly.paid'),- ]+ ],];return $data;diff --git a/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php b/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.phpindex 8bb0402d25..07debb7581 100644--- a/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php+++ b/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php@@ -28,12 +28,12 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator'datasets' => [['label' => trans('firefly.spent'),- 'data' => []+ 'data' => [],],['label' => trans('firefly.earned'),- 'data' => []- ]+ 'data' => [],+ ],],];@@ -95,8 +95,8 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator'datasets' => [['label' => trans('firefly.spent'),- 'data' => []- ]+ 'data' => [],+ ],],];foreach ($entries as $entry) {diff --git a/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php b/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.phpindex bea4b9605a..a33b867911 100644--- a/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php+++ b/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php@@ -31,8 +31,8 @@ class ChartJsPiggyBankChartGenerator implements PiggyBankChartGenerator'datasets' => [['label' => 'Diff',- 'data' => []- ]+ 'data' => [],+ ],],];$sum = '0';diff --git a/app/Generator/Chart/Report/ChartJsReportChartGenerator.php b/app/Generator/Chart/Report/ChartJsReportChartGenerator.phpindex 1089ba7305..3b64f1a8b1 100644--- a/app/Generator/Chart/Report/ChartJsReportChartGenerator.php+++ b/app/Generator/Chart/Report/ChartJsReportChartGenerator.php@@ -27,12 +27,12 @@ class ChartJsReportChartGenerator implements ReportChartGenerator'datasets' => [['label' => trans('firefly.income'),- 'data' => []+ 'data' => [],],['label' => trans('firefly.expenses'),- 'data' => []- ]+ 'data' => [],+ ],],];@@ -60,12 +60,12 @@ class ChartJsReportChartGenerator implements ReportChartGenerator'datasets' => [['label' => trans('firefly.income'),- 'data' => []+ 'data' => [],],['label' => trans('firefly.expenses'),- 'data' => []- ]+ 'data' => [],+ ],],];$data['datasets'][0]['data'][] = round($income, 2);@@ -92,12 +92,12 @@ class ChartJsReportChartGenerator implements ReportChartGenerator'datasets' => [['label' => trans('firefly.income'),- 'data' => []+ 'data' => [],],['label' => trans('firefly.expenses'),- 'data' => []- ]+ 'data' => [],+ ],],];@@ -126,12 +126,12 @@ class ChartJsReportChartGenerator implements ReportChartGenerator'datasets' => [['label' => trans('firefly.income'),- 'data' => []+ 'data' => [],],['label' => trans('firefly.expenses'),- 'data' => []- ]+ 'data' => [],+ ],],];$data['datasets'][0]['data'][] = round($income, 2);diff --git a/app/Handlers/Events/FireRulesForStore.php b/app/Handlers/Events/FireRulesForStore.phpindex 1fa8554217..96853ad607 100644--- a/app/Handlers/Events/FireRulesForStore.php+++ b/app/Handlers/Events/FireRulesForStore.php@@ -74,7 +74,7 @@ class FireRulesForStore}}-// echo 'Done processing rules. See log.';-// exit;+ // echo 'Done processing rules. See log.';+ // exit;}}\ No newline at end of filediff --git a/app/Handlers/Events/FireRulesForUpdate.php b/app/Handlers/Events/FireRulesForUpdate.phpindex d0b36c45dd..a88a097e85 100644--- a/app/Handlers/Events/FireRulesForUpdate.php+++ b/app/Handlers/Events/FireRulesForUpdate.php@@ -8,6 +8,7 @@*/namespace FireflyIII\Handlers\Events;+use FireflyIII\Events\TransactionJournalUpdated;use Log;diff --git a/app/Helpers/Csv/Converter/CategoryName.php b/app/Helpers/Csv/Converter/CategoryName.phpindex 52e371ad58..54fa5b72f7 100644--- a/app/Helpers/Csv/Converter/CategoryName.php+++ b/app/Helpers/Csv/Converter/CategoryName.php@@ -24,7 +24,7 @@ class CategoryName extends BasicConverter implements ConverterInterface$category = Category::firstOrCreateEncrypted(['name' => $this->value,- 'user_id' => Auth::user()->id+ 'user_id' => Auth::user()->id,]);}diff --git a/app/Helpers/Csv/Data.php b/app/Helpers/Csv/Data.phpindex f0271091aa..2d6388792b 100644--- a/app/Helpers/Csv/Data.php+++ b/app/Helpers/Csv/Data.php@@ -64,7 +64,7 @@ class Dataprotected function sessionHasHeaders(){if (Session::has('csv-has-headers')) {- $this->hasHeaders = (bool) Session::get('csv-has-headers');+ $this->hasHeaders = (bool)Session::get('csv-has-headers');}}@@ -78,42 +78,42 @@ class Dataprotected function sessionDateFormat(){if (Session::has('csv-date-format')) {- $this->dateFormat = (string) Session::get('csv-date-format');+ $this->dateFormat = (string)Session::get('csv-date-format');}}protected function sessionCsvFileLocation(){if (Session::has('csv-file')) {- $this->csvFileLocation = (string) Session::get('csv-file');+ $this->csvFileLocation = (string)Session::get('csv-file');}}protected function sessionMap(){if (Session::has('csv-map')) {- $this->map = (array) Session::get('csv-map');+ $this->map = (array)Session::get('csv-map');}}protected function sessionRoles(){if (Session::has('csv-roles')) {- $this->roles = (array) Session::get('csv-roles');+ $this->roles = (array)Session::get('csv-roles');}}protected function sessionMapped(){if (Session::has('csv-mapped')) {- $this->mapped = (array) Session::get('csv-mapped');+ $this->mapped = (array)Session::get('csv-mapped');}}protected function sessionSpecifix(){if (Session::has('csv-specifix')) {- $this->specifix = (array) Session::get('csv-specifix');+ $this->specifix = (array)Session::get('csv-specifix');}}@@ -135,7 +135,7 @@ class Data/***- * @param mixed $dateFormat+ * @param mixed $dateFormat*/public function setDateFormat($dateFormat){@@ -145,7 +145,7 @@ class Data/***- * @param int $importAccount+ * @param int $importAccount*/public function setImportAccount($importAccount){@@ -164,7 +164,7 @@ class Data/***- * @param bool $hasHeaders+ * @param bool $hasHeaders*/public function setHasHeaders($hasHeaders){@@ -183,7 +183,7 @@ class Data/***- * @param array $map+ * @param array $map*/public function setMap(array $map){@@ -202,7 +202,7 @@ class Data/***- * @param array $mapped+ * @param array $mapped*/public function setMapped(array $mapped){@@ -219,19 +219,19 @@ class Dataif (strlen($this->csvFileContent) === 0) {$this->loadCsvFile();}-+if (is_null($this->reader)) {$this->reader = Reader::createFromString($this->getCsvFileContent());$this->reader->setDelimiter($this->delimiter);}-+return $this->reader;}protected function loadCsvFile(){- $file = $this->getCsvFileLocation();- $content = file_get_contents($file);+ $file = $this->getCsvFileLocation();+ $content = file_get_contents($file);$contentDecrypted = Crypt::decrypt($content);$this->setCsvFileContent($contentDecrypted);}@@ -247,7 +247,7 @@ class Data/***- * @param string $csvFileLocation+ * @param string $csvFileLocation*/public function setCsvFileLocation($csvFileLocation){@@ -266,7 +266,7 @@ class Data/***- * @param string $csvFileContent+ * @param string $csvFileContent*/public function setCsvFileContent($csvFileContent){@@ -284,7 +284,7 @@ class Data/***- * @param array $roles+ * @param array $roles*/public function setRoles(array $roles){@@ -303,7 +303,7 @@ class Data/***- * @param array $specifix+ * @param array $specifix*/public function setSpecifix($specifix){@@ -322,7 +322,7 @@ class Data/***- * @param string $delimiter+ * @param string $delimiter*/public function setDelimiter($delimiter){diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.phpindex 813a2f34f4..7daede4b45 100644--- a/app/Helpers/Report/ReportHelper.php+++ b/app/Helpers/Report/ReportHelper.php@@ -18,8 +18,8 @@ use FireflyIII\Helpers\Collection\Expense;use FireflyIII\Helpers\Collection\Income;use FireflyIII\Models\Account;use FireflyIII\Models\Bill;-use FireflyIII\Models\Budget;use FireflyIII\Models\Budget as BudgetModel;+use FireflyIII\Models\Budget;use FireflyIII\Models\LimitRepetition;use FireflyIII\Models\Tag;use FireflyIII\Models\TransactionJournal;diff --git a/app/Helpers/Report/ReportQuery.php b/app/Helpers/Report/ReportQuery.phpindex 24fa89dc7d..0180571484 100644--- a/app/Helpers/Report/ReportQuery.php+++ b/app/Helpers/Report/ReportQuery.php@@ -50,7 +50,7 @@ class ReportQuery implements ReportQueryInterface->get([DB::Raw('DATE_FORMAT(`transaction_journals`.`date`,"%Y-%m") AS `dateFormatted`'),- DB::Raw('SUM(`t_from`.`amount`) AS `sum`')+ DB::Raw('SUM(`t_from`.`amount`) AS `sum`'),]);$array = [];@@ -95,7 +95,7 @@ class ReportQuery implements ReportQueryInterface->get([DB::Raw('DATE_FORMAT(`transaction_journals`.`date`,"%Y-%m") AS `dateFormatted`'),- DB::Raw('SUM(`t_to`.`amount`) AS `sum`')+ DB::Raw('SUM(`t_to`.`amount`) AS `sum`'),]);$array = [];diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.phpindex 306f6463e8..44d210ca40 100644--- a/app/Http/Controllers/AccountController.php+++ b/app/Http/Controllers/AccountController.php@@ -133,7 +133,7 @@ class AccountController extends Controller'ccMonthlyPaymentDate' => $account->getMeta('ccMonthlyPaymentDate'),'openingBalanceDate' => $openingBalance ? $openingBalance->date->format('Y-m-d') : null,'openingBalance' => $openingBalanceAmount,- 'virtualBalance' => round($account->virtual_balance, 2)+ 'virtualBalance' => round($account->virtual_balance, 2),];Session::flash('preFilled', $preFilled);Session::flash('gaEventCategory', 'accounts');diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.phpindex 2d33717042..6241057961 100755--- a/app/Http/Controllers/Controller.php+++ b/app/Http/Controllers/Controller.php@@ -57,7 +57,7 @@ class Controller extends BaseController$localeconv = ['mon_decimal_point' => $numberFormatter->getSymbol($numberFormatter->getAttribute(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL)),'mon_thousands_sep' => $numberFormatter->getSymbol($numberFormatter->getAttribute(NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL)),- 'frac_digits' => $numberFormatter->getAttribute(NumberFormatter::MAX_FRACTION_DIGITS)+ 'frac_digits' => $numberFormatter->getAttribute(NumberFormatter::MAX_FRACTION_DIGITS),];View::share('monthFormat', $this->monthFormat);View::share('monthAndDayFormat', $this->monthAndDayFormat);diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.phpindex 83ed844119..a3b93b97ac 100644--- a/app/Http/Controllers/PiggyBankController.php+++ b/app/Http/Controllers/PiggyBankController.php@@ -186,7 +186,7 @@ class PiggyBankController extends Controller'leftForPiggyBanks' => $repository->leftOnAccount($account, $end),'sumOfSaved' => $piggyBank->savedSoFar,'sumOfTargets' => round($piggyBank->targetamount, 2),- 'leftToSave' => $piggyBank->leftToSave+ 'leftToSave' => $piggyBank->leftToSave,];} else {$accounts[$account->id]['sumOfSaved'] = bcadd($accounts[$account->id]['sumOfSaved'], $piggyBank->savedSoFar);diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.phpindex 684d9e2d98..da581288e5 100644--- a/app/Http/Controllers/ProfileController.php+++ b/app/Http/Controllers/ProfileController.php@@ -126,7 +126,7 @@ class ProfileController extends Controller'email' => $email,'password' => 'deleted','blocked' => 1,- 'blocked_code' => 'deleted'+ 'blocked_code' => 'deleted',]);diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.phpindex bf0baa0805..bdd0c6bab5 100644--- a/app/Http/Controllers/TagController.php+++ b/app/Http/Controllers/TagController.php@@ -60,7 +60,7 @@ class TagController extends Controller$subTitleIcon = 'fa-tag';$preFilled = [- 'tagMode' => 'nothing'+ 'tagMode' => 'nothing',];if (!Input::old('tagMode')) {Session::flash('preFilled', $preFilled);diff --git a/app/Http/Middleware/Binder.php b/app/Http/Middleware/Binder.phpindex 088f1e9a8d..3a3ccb3c85 100644--- a/app/Http/Middleware/Binder.php+++ b/app/Http/Middleware/Binder.php@@ -54,6 +54,7 @@ class Binderprivate function performBinding($key, $value, $route){$class = $this->binders[$key];+return $class::routeBinder($value, $route);}}diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.phpindex 2686edac4f..8784890ec9 100755--- a/app/Http/Middleware/EncryptCookies.php+++ b/app/Http/Middleware/EncryptCookies.php@@ -16,7 +16,8 @@ class EncryptCookies extends BaseEncrypter** @var array*/- protected $except = [- //- ];+ protected $except+ = [+ //+ ];}diff --git a/app/Http/Requests/AccountFormRequest.php b/app/Http/Requests/AccountFormRequest.phpindex 578c034176..004336e184 100644--- a/app/Http/Requests/AccountFormRequest.php+++ b/app/Http/Requests/AccountFormRequest.php@@ -53,7 +53,7 @@ class AccountFormRequest extends Request'ccMonthlyPaymentDate' => 'date','amount_currency_id_openingBalance' => 'exists:transaction_currencies,id','amount_currency_id_virtualBalance' => 'exists:transaction_currencies,id',- 'what' => 'in:' . $types+ 'what' => 'in:' . $types,];}}diff --git a/app/Http/Requests/BudgetFormRequest.php b/app/Http/Requests/BudgetFormRequest.phpindex 11207e8037..8d99f5f52a 100644--- a/app/Http/Requests/BudgetFormRequest.php+++ b/app/Http/Requests/BudgetFormRequest.php@@ -36,7 +36,7 @@ class BudgetFormRequest extends Requestreturn ['name' => $nameRule,- 'active' => 'numeric|between:0,1'+ 'active' => 'numeric|between:0,1',];}}diff --git a/app/Http/Requests/RuleFormRequest.php b/app/Http/Requests/RuleFormRequest.phpindex d5e7423b36..be60f0e06a 100644--- a/app/Http/Requests/RuleFormRequest.php+++ b/app/Http/Requests/RuleFormRequest.php@@ -62,6 +62,7 @@ class RuleFormRequest extends Requestfor ($i = 0; $i < 10; $i++) {$rules['rule-action-value.' . $i] = 'required_if:rule-action.' . $i . ',' . $contextActions . '|ruleActionValue';}+return $rules;}}diff --git a/app/Http/Requests/RuleGroupFormRequest.php b/app/Http/Requests/RuleGroupFormRequest.phpindex 638c50341b..112a1dcca6 100644--- a/app/Http/Requests/RuleGroupFormRequest.php+++ b/app/Http/Requests/RuleGroupFormRequest.php@@ -42,7 +42,7 @@ class RuleGroupFormRequest extends Request}return [- 'title' => $titleRule,+ 'title' => $titleRule,'description' => 'between:1,5000',];}diff --git a/app/Http/Requests/TagFormRequest.php b/app/Http/Requests/TagFormRequest.phpindex 28773c874c..a4f5da9021 100644--- a/app/Http/Requests/TagFormRequest.php+++ b/app/Http/Requests/TagFormRequest.php@@ -42,7 +42,7 @@ class TagFormRequest extends Request'latitude' => 'numeric|min:-90|max:90','longitude' => 'numeric|min:-90|max:90','zoomLevel' => 'numeric|min:0|max:80',- 'tagMode' => 'required|in:nothing,balancingAct,advancePayment'+ 'tagMode' => 'required|in:nothing,balancingAct,advancePayment',];}}diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.phpindex 5b23dd2533..846ff8954b 100644--- a/app/Models/AccountMeta.php+++ b/app/Models/AccountMeta.php@@ -17,9 +17,9 @@ use Illuminate\Database\Eloquent\Model;class AccountMeta extends Model{+ protected $dates = ['created_at', 'updated_at'];protected $fillable = ['account_id', 'name', 'data'];protected $table = 'account_meta';- protected $dates = ['created_at', 'updated_at'];/***diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.phpindex 1a05050db5..0a05e24836 100644--- a/app/Models/BudgetLimit.php+++ b/app/Models/BudgetLimit.php@@ -22,7 +22,7 @@ class BudgetLimit extends Model{protected $hidden = ['amount_encrypted'];- protected $dates = ['created_at', 'updated_at', 'startdate'];+ protected $dates = ['created_at', 'updated_at', 'startdate'];/*** @return \Illuminate\Database\Eloquent\Relations\BelongsTodiff --git a/app/Models/Component.php b/app/Models/Component.phpindex 1a950ad808..c7edc8dca4 100644--- a/app/Models/Component.php+++ b/app/Models/Component.php@@ -1,8 +1,6 @@<?php namespace FireflyIII\Models;-use Carbon\Carbon;use Illuminate\Database\Eloquent\Model;-use Illuminate\Database\Eloquent\SoftDeletes;/*** Class Componentdiff --git a/app/Models/PiggyBankEvent.php b/app/Models/PiggyBankEvent.phpindex 310b34ed09..1710da1617 100644--- a/app/Models/PiggyBankEvent.php+++ b/app/Models/PiggyBankEvent.php@@ -19,9 +19,9 @@ use Illuminate\Database\Eloquent\Model;class PiggyBankEvent extends Model{+ protected $dates = ['created_at', 'updated_at', 'date'];protected $fillable = ['piggy_bank_id', 'transaction_journal_id', 'date', 'amount'];protected $hidden = ['amount_encrypted'];- protected $dates = ['created_at', 'updated_at', 'date'];/*** @return \Illuminate\Database\Eloquent\Relations\BelongsTodiff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.phpindex 92b0b7564b..b8fb7eec61 100644--- a/app/Models/PiggyBankRepetition.php+++ b/app/Models/PiggyBankRepetition.php@@ -24,7 +24,7 @@ class PiggyBankRepetition extends Modelprotected $fillable = ['piggy_bank_id', 'startdate', 'targetdate', 'currentamount'];protected $hidden = ['currentamount_encrypted'];- protected $dates = ['created_at', 'updated_at', 'startdate', 'targetdate'];+ protected $dates = ['created_at', 'updated_at', 'startdate', 'targetdate'];/*** @return \Illuminate\Database\Eloquent\Relations\BelongsTodiff --git a/app/Models/Preference.php b/app/Models/Preference.phpindex 625548d171..641054e3f4 100644--- a/app/Models/Preference.php+++ b/app/Models/Preference.php@@ -23,7 +23,8 @@ class Preference extends Modelprotected $fillable = ['user_id', 'data', 'name'];protected $hidden = ['data_encrypted', 'name_encrypted'];-protected $dates = ['created_at', 'updated_at'];+ protected $dates = ['created_at', 'updated_at'];+/*** @param $value*diff --git a/app/Models/Rule.php b/app/Models/Rule.phpindex b99d6334b0..faf2110825 100644--- a/app/Models/Rule.php+++ b/app/Models/Rule.php@@ -37,6 +37,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;class Rule extends Model{use SoftDeletes;+/*** @return \Illuminate\Database\Eloquent\Relations\BelongsTo*/diff --git a/app/Models/RuleAction.php b/app/Models/RuleAction.phpindex 257ae41f7d..fd65f781d5 100644--- a/app/Models/RuleAction.php+++ b/app/Models/RuleAction.php@@ -15,15 +15,15 @@ use Illuminate\Database\Eloquent\Model;/*** FireflyIII\Models\RuleAction*- * @property integer $id- * @property \Carbon\Carbon $created_at- * @property \Carbon\Carbon $updated_at- * @property integer $rule_id- * @property integer $order- * @property boolean $active- * @property boolean $stop_processing- * @property string $action_type- * @property string $action_value+ * @property integer $id+ * @property \Carbon\Carbon $created_at+ * @property \Carbon\Carbon $updated_at+ * @property integer $rule_id+ * @property integer $order+ * @property boolean $active+ * @property boolean $stop_processing+ * @property string $action_type+ * @property string $action_value* @property-read \FireflyIII\Models\Rule $rule*/class RuleAction extends Modeldiff --git a/app/Models/RuleTrigger.php b/app/Models/RuleTrigger.phpindex daaeea0e98..fb504433a8 100644--- a/app/Models/RuleTrigger.php+++ b/app/Models/RuleTrigger.php@@ -14,16 +14,16 @@ use Illuminate\Database\Eloquent\Model;/*** FireflyIII\Models\RuleTrigger*- * @property integer $id- * @property \Carbon\Carbon $created_at- * @property \Carbon\Carbon $updated_at- * @property integer $rule_id- * @property integer $order- * @property string $title- * @property string $trigger_type- * @property string $trigger_value- * @property boolean $active- * @property boolean $stop_processing+ * @property integer $id+ * @property \Carbon\Carbon $created_at+ * @property \Carbon\Carbon $updated_at+ * @property integer $rule_id+ * @property integer $order+ * @property string $title+ * @property string $trigger_type+ * @property string $trigger_value+ * @property boolean $active+ * @property boolean $stop_processing* @property-read \FireflyIII\Models\Rule $rule*/class RuleTrigger extends Modeldiff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.phpindex 0666667ec6..7d3f4d2b73 100755--- a/app/Providers/AuthServiceProvider.php+++ b/app/Providers/AuthServiceProvider.php@@ -17,14 +17,16 @@ class AuthServiceProvider extends ServiceProvider** @var array*/- protected $policies = [- 'FireflyIII\Model' => 'FireflyIII\Policies\ModelPolicy',- ];+ protected $policies+ = [+ 'FireflyIII\Model' => 'FireflyIII\Policies\ModelPolicy',+ ];/*** Register any application authentication / authorization services.*- * @param \Illuminate\Contracts\Auth\Access\Gate $gate+ * @param \Illuminate\Contracts\Auth\Access\Gate $gate+ ** @return void*/public function boot(GateContract $gate)diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.phpindex 7b86a54d04..7d0b742adf 100755--- a/app/Providers/EventServiceProvider.php+++ b/app/Providers/EventServiceProvider.php@@ -29,19 +29,19 @@ class EventServiceProvider extends ServiceProvider*/protected $listen= [- 'FireflyIII\Events\TransactionJournalUpdated' => [+ 'FireflyIII\Events\TransactionJournalUpdated' => ['FireflyIII\Handlers\Events\ScanForBillsAfterUpdate','FireflyIII\Handlers\Events\UpdateJournalConnection','FireflyIII\Handlers\Events\FireRulesForUpdate',],- 'FireflyIII\Events\TransactionJournalStored' => [+ 'FireflyIII\Events\TransactionJournalStored' => ['FireflyIII\Handlers\Events\ScanForBillsAfterStore','FireflyIII\Handlers\Events\ConnectJournalToPiggyBank','FireflyIII\Handlers\Events\FireRulesForStore',- ]+ ],];diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.phpindex 279fd8f67d..ba3b700a19 100644--- a/app/Providers/FireflyServiceProvider.php+++ b/app/Providers/FireflyServiceProvider.php@@ -11,8 +11,8 @@ use FireflyIII\Support\Twig\Budget;use FireflyIII\Support\Twig\General;use FireflyIII\Support\Twig\Journal;use FireflyIII\Support\Twig\PiggyBank;-use FireflyIII\Support\Twig\Translation;use FireflyIII\Support\Twig\Rule;+use FireflyIII\Support\Twig\Translation;use FireflyIII\Validation\FireflyValidator;use Illuminate\Support\ServiceProvider;use Twig;diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.phpindex 34cdcf76c6..6e583159bf 100755--- a/app/Providers/RouteServiceProvider.php+++ b/app/Providers/RouteServiceProvider.php@@ -2,8 +2,8 @@namespace FireflyIII\Providers;-use Illuminate\Routing\Router;use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;+use Illuminate\Routing\Router;/*** Class RouteServiceProvider@@ -24,7 +24,8 @@ class RouteServiceProvider extends ServiceProvider/*** Define your route model bindings, pattern filters, etc.*- * @param \Illuminate\Routing\Router $router+ * @param \Illuminate\Routing\Router $router+ ** @return void*/public function boot(Router $router)@@ -37,13 +38,16 @@ class RouteServiceProvider extends ServiceProvider/*** Define the routes for the application.*- * @param \Illuminate\Routing\Router $router+ * @param \Illuminate\Routing\Router $router+ ** @return void*/public function map(Router $router){- $router->group(['namespace' => $this->namespace], function ($router) {+ $router->group(+ ['namespace' => $this->namespace], function ($router) {require app_path('Http/routes.php');- });+ }+ );}}diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.phpindex 17386d9797..29bd373877 100644--- a/app/Repositories/Bill/BillRepository.php+++ b/app/Repositories/Bill/BillRepository.php@@ -61,7 +61,7 @@ class BillRepository implements BillRepositoryInterface->get(['transaction_journals.bill_id',- DB::Raw('SUM(`transactions`.`amount`) as `journalAmount`')+ DB::Raw('SUM(`transactions`.`amount`) as `journalAmount`'),]);@@ -476,7 +476,7 @@ class BillRepository implements BillRepositoryInterface->get(['bills.*',- DB::Raw('(`bills`.`amount_min` + `bills`.`amount_max` / 2) as `expectedAmount`')+ DB::Raw('(`bills`.`amount_min` + `bills`.`amount_max` / 2) as `expectedAmount`'),])->sortBy('name');diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.phpindex 70d9e71b4b..715665e372 100644--- a/app/Repositories/Budget/BudgetRepository.php+++ b/app/Repositories/Budget/BudgetRepository.php@@ -89,7 +89,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn->get([DB::Raw('DATE_FORMAT(`transaction_journals`.`date`, "%Y-%m") AS `dateFormatted`'),- DB::Raw('SUM(`transactions`.`amount`) as `monthlyAmount`')+ DB::Raw('SUM(`transactions`.`amount`) as `monthlyAmount`'),]);@@ -316,7 +316,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn['budgets.*',DB::Raw('DATE_FORMAT(`transaction_journals`.`date`, "%Y-%m") AS `dateFormatted`'),- DB::Raw('SUM(`transactions`.`amount`) AS `sumAmount`')+ DB::Raw('SUM(`transactions`.`amount`) AS `sumAmount`'),]);@@ -559,7 +559,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn['budgets.*',DB::Raw('DATE_FORMAT(`limit_repetitions`.`startdate`,"%Y") as `dateFormatted`'),- DB::Raw('SUM(`limit_repetitions`.`amount`) as `budgeted`')+ DB::Raw('SUM(`limit_repetitions`.`amount`) as `budgeted`'),]);@@ -603,7 +603,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn['budgets.*',DB::Raw('DATE_FORMAT(`transaction_journals`.`date`, "%Y") AS `dateFormatted`'),- DB::Raw('SUM(`transactions`.`amount`) AS `sumAmount`')+ DB::Raw('SUM(`transactions`.`amount`) AS `sumAmount`'),]);@@ -720,7 +720,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn->get(['t_from.account_id', 'budget_transaction_journal.budget_id',- DB::Raw('SUM(`t_from`.`amount`) AS `spent`')+ DB::Raw('SUM(`t_from`.`amount`) AS `spent`'),]);diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.phpindex 10d439b4fa..e0b3dc3dc8 100644--- a/app/Repositories/Journal/JournalRepository.php+++ b/app/Repositories/Journal/JournalRepository.php@@ -196,14 +196,14 @@ class JournalRepository implements JournalRepositoryInterface['account_id' => $fromAccount->id,'transaction_journal_id' => $journal->id,- 'amount' => $data['amount'] * -1+ 'amount' => $data['amount'] * -1,]);Transaction::create( // second transaction.['account_id' => $toAccount->id,'transaction_journal_id' => $journal->id,- 'amount' => $data['amount']+ 'amount' => $data['amount'],]);$journal->completed = 1;diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.phpindex 5406054c79..d0368d05f1 100644--- a/app/Repositories/Tag/TagRepository.php+++ b/app/Repositories/Tag/TagRepository.php@@ -131,7 +131,7 @@ class TagRepository implements TagRepositoryInterface->get(['t_to.account_id',- DB::Raw('SUM(`t_to`.`amount`) as `sum`')+ DB::Raw('SUM(`t_to`.`amount`) as `sum`'),]);diff --git a/app/Rules/Actions/ActionInterface.php b/app/Rules/Actions/ActionInterface.phpindex 16a597b7e1..91cbec46c7 100644--- a/app/Rules/Actions/ActionInterface.php+++ b/app/Rules/Actions/ActionInterface.php@@ -8,6 +8,7 @@*/namespace FireflyIII\Rules\Actions;+use FireflyIII\Models\RuleAction;use FireflyIII\Models\TransactionJournal;@@ -21,7 +22,7 @@ interface ActionInterface/*** TriggerInterface constructor.*- * @param RuleAction $action+ * @param RuleAction $action* @param TransactionJournal $journal*/public function __construct(RuleAction $action, TransactionJournal $journal);diff --git a/app/Rules/Actions/SetBudget.php b/app/Rules/Actions/SetBudget.phpindex 5f77b75595..5373fdd6d4 100644--- a/app/Rules/Actions/SetBudget.php+++ b/app/Rules/Actions/SetBudget.php@@ -15,6 +15,7 @@ use FireflyIII\Models\RuleAction;use FireflyIII\Models\TransactionJournal;use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;use Log;+/*** Class SetBudget*@@ -56,7 +57,7 @@ class SetBudget implements ActionInterfaceLog::debug('Will set budget "' . $search . '" (#' . $budget->id . ') on journal #' . $this->journal->id . '.');$this->journal->budgets()->save($budget);} else {- Log::debug('Could not find budget "'.$search.'". Failed.');+ Log::debug('Could not find budget "' . $search . '". Failed.');}return true;diff --git a/app/Support/Domain.php b/app/Support/Domain.phpindex d1f8be1fed..8506fcc998 100644--- a/app/Support/Domain.php+++ b/app/Support/Domain.php@@ -30,16 +30,16 @@ class Domain/*** @return array*/- public static function getRuleTriggers()+ public static function getRuleActions(){- return Config::get('firefly.rule-triggers');+ return Config::get('firefly.rule-actions');}/*** @return array*/- public static function getRuleActions()+ public static function getRuleTriggers(){- return Config::get('firefly.rule-actions');+ return Config::get('firefly.rule-triggers');}}\ No newline at end of filediff --git a/app/Support/Twig/Journal.php b/app/Support/Twig/Journal.phpindex 628745d1f8..29b9c2d31f 100644--- a/app/Support/Twig/Journal.php+++ b/app/Support/Twig/Journal.php@@ -37,7 +37,7 @@ class Journal extends Twig_Extension{$functions = [$this->invalidJournal(),- $this->relevantTags()+ $this->relevantTags(),];return $functions;diff --git a/app/User.php b/app/User.phpindex 1fb85eb23f..b274e6d9dc 100755--- a/app/User.php+++ b/app/User.php@@ -9,24 +9,24 @@ use Zizaco\Entrust\Traits\EntrustUserTrait;* Class User** @package FireflyIII- * @property integer $id- * @property \Carbon\Carbon $created_at- * @property \Carbon\Carbon $updated_at- * @property string $email- * @property string $password- * @property string $remember_token- * @property string $reset- * @property boolean $blocked- * @property string $blocked_code- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Account[] $accounts- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Attachment[] $attachments- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Tag[] $tags- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Bill[] $bills- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Budget[] $budgets- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Category[] $categories- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Preference[] $preferences+ * @property integer $id+ * @property \Carbon\Carbon $created_at+ * @property \Carbon\Carbon $updated_at+ * @property string $email+ * @property string $password+ * @property string $remember_token+ * @property string $reset+ * @property boolean $blocked+ * @property string $blocked_code+ * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Account[] $accounts+ * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Attachment[] $attachments+ * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Tag[] $tags+ * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Bill[] $bills+ * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Budget[] $budgets+ * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Category[] $categories+ * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Preference[] $preferences* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionjournals- * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Role[] $roles+ * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Role[] $roles*/class User extends Authenticatable{@@ -74,81 +74,81 @@ class User extends Authenticatable/*** @return \Illuminate\Database\Eloquent\Relations\HasMany*/- public function tags()+ public function bills(){- return $this->hasMany('FireflyIII\Models\Tag');+ return $this->hasMany('FireflyIII\Models\Bill');}/*** @return \Illuminate\Database\Eloquent\Relations\HasMany*/- public function rules()+ public function budgets(){- return $this->hasMany('FireflyIII\Models\Rule');+ return $this->hasMany('FireflyIII\Models\Budget');}/*** @return \Illuminate\Database\Eloquent\Relations\HasMany*/- public function ruleGroups()+ public function categories(){- return $this->hasMany('FireflyIII\Models\RuleGroup');+ return $this->hasMany('FireflyIII\Models\Category');}/**- * @return \Illuminate\Database\Eloquent\Relations\HasMany+ * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough*/- public function bills()+ public function piggyBanks(){- return $this->hasMany('FireflyIII\Models\Bill');+ return $this->hasManyThrough('FireflyIII\Models\PiggyBank', 'FireflyIII\Models\Account');}/*** @return \Illuminate\Database\Eloquent\Relations\HasMany*/- public function budgets()+ public function preferences(){- return $this->hasMany('FireflyIII\Models\Budget');+ return $this->hasMany('FireflyIII\Models\Preference');}/*** @return \Illuminate\Database\Eloquent\Relations\HasMany*/- public function categories()+ public function ruleGroups(){- return $this->hasMany('FireflyIII\Models\Category');+ return $this->hasMany('FireflyIII\Models\RuleGroup');}/**- * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough+ * @return \Illuminate\Database\Eloquent\Relations\HasMany*/- public function piggyBanks()+ public function rules(){- return $this->hasManyThrough('FireflyIII\Models\PiggyBank', 'FireflyIII\Models\Account');+ return $this->hasMany('FireflyIII\Models\Rule');}/**- * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough+ * @return \Illuminate\Database\Eloquent\Relations\HasMany*/- public function transactions()+ public function tags(){- return $this->hasManyThrough('FireflyIII\Models\Transaction', 'FireflyIII\Models\TransactionJournal');+ return $this->hasMany('FireflyIII\Models\Tag');}/*** @return \Illuminate\Database\Eloquent\Relations\HasMany*/- public function preferences()+ public function transactionjournals(){- return $this->hasMany('FireflyIII\Models\Preference');+ return $this->hasMany('FireflyIII\Models\TransactionJournal');}/**- * @return \Illuminate\Database\Eloquent\Relations\HasMany+ * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough*/- public function transactionjournals()+ public function transactions(){- return $this->hasMany('FireflyIII\Models\TransactionJournal');+ return $this->hasManyThrough('FireflyIII\Models\Transaction', 'FireflyIII\Models\TransactionJournal');}}diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.phpindex fa7ef1932c..be816a7d26 100644--- a/resources/lang/en_US/firefly.php+++ b/resources/lang/en_US/firefly.php@@ -282,7 +282,7 @@ return ['csv_specifix_RabobankDescription' => 'Select this when you\'re importing Rabobank CSV export files.','csv_specifix_Dummy' => 'Checking this has no effect whatsoever.','csv_import_account_help' => 'If your CSV file does NOT contain information about your asset account(s), use this dropdown to select to which account the transactions in the CSV belong to.',- 'csv_delimiter_help' => 'Choose the field delimiter that is used in your input file. If not sure, comma is the safest option.',+ 'csv_delimiter_help' => 'Choose the field delimiter that is used in your input file. If not sure, comma is the safest option.','csv_date_parse_error' => 'Could not parse a valid date from ":value", using the format ":format". Are you sure your CSV is correct?',// create new stuff:diff --git a/resources/lang/en_US/passwords.php b/resources/lang/en_US/passwords.phpindex f248128198..125f093fa8 100644--- a/resources/lang/en_US/passwords.php+++ b/resources/lang/en_US/passwords.php@@ -17,6 +17,6 @@ return ["token" => "This password reset token is invalid.","sent" => "We have e-mailed your password reset link!","reset" => "Your password has been reset!",- 'blocked' => 'Nice try though.'+ 'blocked' => 'Nice try though.',];diff --git a/resources/lang/fr_FR/firefly.php b/resources/lang/fr_FR/firefly.phpindex 3508e76839..b0a5e55779 100755--- a/resources/lang/fr_FR/firefly.php+++ b/resources/lang/fr_FR/firefly.php@@ -282,7 +282,7 @@ return ['csv_specifix_RabobankDescription' => 'Select this when you\'re importing Rabobank CSV export files.','csv_specifix_Dummy' => 'Checking this has no effect whatsoever.','csv_import_account_help' => 'If your CSV file does NOT contain information about your asset account(s), use this dropdown to select to which account the transactions in the CSV belong to.',- 'csv_delimiter_help' => 'Choose the field delimiter that is used in your input file. If not sure, comma is the safest option.',+ 'csv_delimiter_help' => 'Choose the field delimiter that is used in your input file. If not sure, comma is the safest option.','csv_date_parse_error' => 'Could not parse a valid date from ":value", using the format ":format". Are you sure your CSV is correct?',// create new stuff:diff --git a/resources/lang/fr_FR/passwords.php b/resources/lang/fr_FR/passwords.phpindex 81b522829e..5b2f00ff3a 100755--- a/resources/lang/fr_FR/passwords.php+++ b/resources/lang/fr_FR/passwords.php@@ -17,6 +17,6 @@ return ["token" => "Le jeton de réinitialisation de mot de passe est invalide.","sent" => "Nous avons envoyé votre lien de réinitialisation de mot de passe!","reset" => "Le mot de passe a été réinitialisé!",- 'blocked' => 'Nice try though.'+ 'blocked' => 'Nice try though.',];diff --git a/resources/lang/nl_NL/firefly.php b/resources/lang/nl_NL/firefly.phpindex 73fe1865c3..3493ef0643 100755--- a/resources/lang/nl_NL/firefly.php+++ b/resources/lang/nl_NL/firefly.php@@ -282,7 +282,7 @@ return ['csv_specifix_RabobankDescription' => 'Vink dit aan als je Rabobank bestanden importeert.','csv_specifix_Dummy' => 'Dit vinkje doet niks (dummy).','csv_import_account_help' => 'Als jouw CSV bestand geen referenties bevat naar jouw rekening(en), geef dan hier aan om welke rekening het gaat.',- 'csv_delimiter_help' => 'Kies het veldscheidingsteken dat in het invoerbestand is gebruikt. Bij twijfel is de komma de veiligste optie.',+ 'csv_delimiter_help' => 'Kies het veldscheidingsteken dat in het invoerbestand is gebruikt. Bij twijfel is de komma de veiligste optie.','csv_date_parse_error' => 'Firefly kan van ":value" geen datum maken, gegeven het formaat ":format". Weet je zeker dat je CSV goed is?',// create new stuff:diff --git a/resources/lang/nl_NL/passwords.php b/resources/lang/nl_NL/passwords.phpindex 6b189b754b..fc84b44aa5 100755--- a/resources/lang/nl_NL/passwords.php+++ b/resources/lang/nl_NL/passwords.php@@ -17,6 +17,6 @@ return ["token" => "Ongeldig token! Sorry","sent" => "Je krijgt een mailtje met een linkje om je wachtwoord te herstellen!","reset" => "Je wachtwoord is hersteld!",- 'blocked' => 'Leuk geprobeerd wel.'+ 'blocked' => 'Leuk geprobeerd wel.',];diff --git a/resources/lang/pt_BR/firefly.php b/resources/lang/pt_BR/firefly.phpindex 0ca7a858b5..fedd465573 100755--- a/resources/lang/pt_BR/firefly.php+++ b/resources/lang/pt_BR/firefly.php@@ -282,7 +282,7 @@ return ['csv_specifix_RabobankDescription' => 'Select this when you\'re importing Rabobank CSV export files.','csv_specifix_Dummy' => 'Checking this has no effect whatsoever.','csv_import_account_help' => 'If your CSV file does NOT contain information about your asset account(s), use this dropdown to select to which account the transactions in the CSV belong to.',- 'csv_delimiter_help' => 'Choose the field delimiter that is used in your input file. If not sure, comma is the safest option.',+ 'csv_delimiter_help' => 'Choose the field delimiter that is used in your input file. If not sure, comma is the safest option.','csv_date_parse_error' => 'Could not parse a valid date from ":value", using the format ":format". Are you sure your CSV is correct?',// create new stuff:diff --git a/resources/lang/pt_BR/passwords.php b/resources/lang/pt_BR/passwords.phpindex 7e45ef4749..914544dfb5 100755--- a/resources/lang/pt_BR/passwords.php+++ b/resources/lang/pt_BR/passwords.php@@ -17,6 +17,6 @@ return ["token" => "Este token de redefinição de senha é inválido.","sent" => "Nós te enviamos um email com um link para trocar a senha!","reset" => "Sua senha foi redefinida!",- 'blocked' => 'Nice try though.'+ 'blocked' => 'Nice try though.',];diff --git a/resources/views/emails/registered-html.twig b/resources/views/emails/registered-html.twigindex 532322e75a..5c89c1a81d 100644--- a/resources/views/emails/registered-html.twig+++ b/resources/views/emails/registered-html.twig@@ -62,6 +62,7 @@+</script></body>diff --git a/resources/views/rules/partials/trigger.twig b/resources/views/rules/partials/trigger.twigindex 60cd67c9e2..bc5df80649 100644--- a/resources/views/rules/partials/trigger.twig+++ b/resources/views/rules/partials/trigger.twig@@ -23,9 +23,9 @@<input type="text" value="{{ oldValue }}" name="rule-trigger-value[{{ count }}]"class="form-control">{% if errors.has(('rule-trigger-value.'~count)) %}- <p class="text-danger">- {{ errors.first('rule-trigger-value.'~count) }}- </p>+ <p class="text-danger">+ {{ errors.first('rule-trigger-value.'~count) }}+ </p>{% endif %}</td><td style="width:20%;">diff --git a/resources/views/rules/rule/delete.twig b/resources/views/rules/rule/delete.twigindex 45571583a4..c468dcfa47 100644--- a/resources/views/rules/rule/delete.twig+++ b/resources/views/rules/rule/delete.twig@@ -1,4 +1,3 @@-{% extends "./layout/default.twig" %}{% block breadcrumbs %}