Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Code cleanup.
James Cole3fb14b4708f3
diff --git a/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php b/app/Generator/Chart/Account/ChartJsAccountChartGenerator.phpindex b084678de0..a6ab113571 100644--- a/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php+++ b/app/Generator/Chart/Account/ChartJsAccountChartGenerator.php@@ -20,6 +20,7 @@ class ChartJsAccountChartGenerator implements AccountChartGenerator/*** @codeCoverageIgnore+ ** @param Collection $accounts* @param Carbon $start* @param Carbon $enddiff --git a/app/Generator/Chart/Budget/GoogleBudgetChartGenerator.php b/app/Generator/Chart/Budget/GoogleBudgetChartGenerator.phpindex a463a6b296..848c493b68 100644--- a/app/Generator/Chart/Budget/GoogleBudgetChartGenerator.php+++ b/app/Generator/Chart/Budget/GoogleBudgetChartGenerator.php@@ -37,6 +37,7 @@ class GoogleBudgetChartGenerator implements BudgetChartGenerator/*** @codeCoverageIgnore+ ** @param Collection $entries** @return arraydiff --git a/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php b/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.phpindex 49f92827b7..42e17d875c 100644--- a/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php+++ b/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php@@ -17,7 +17,7 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator/*** @param Collection $entries- * @param string $dateFormat+ * @param string $dateFormat** @return array*/@@ -76,6 +76,7 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator/*** @codeCoverageIgnore+ ** @param Collection $entries** @return arraydiff --git a/app/Generator/Chart/Category/GoogleCategoryChartGenerator.php b/app/Generator/Chart/Category/GoogleCategoryChartGenerator.phpindex b6187f64ed..476f90c998 100644--- a/app/Generator/Chart/Category/GoogleCategoryChartGenerator.php+++ b/app/Generator/Chart/Category/GoogleCategoryChartGenerator.php@@ -99,6 +99,7 @@ class GoogleCategoryChartGenerator implements CategoryChartGenerator$chart->addRowArray($entry);}$chart->generate();+return $chart->getData();}diff --git a/app/Generator/Chart/Report/ChartJsReportChartGenerator.php b/app/Generator/Chart/Report/ChartJsReportChartGenerator.phpindex c1b5cdf5a7..516d2f5332 100644--- a/app/Generator/Chart/Report/ChartJsReportChartGenerator.php+++ b/app/Generator/Chart/Report/ChartJsReportChartGenerator.php@@ -3,7 +3,6 @@namespace FireflyIII\Generator\Chart\Report;use Config;-use Grumpydictator\Gchart\GChart;use Illuminate\Support\Collection;use Preferences;@@ -78,6 +77,7 @@ class ChartJsReportChartGenerator implements ReportChartGenerator$data['datasets'][1]['data'][] = round($expense, 2);$data['datasets'][0]['data'][] = round(($income / $count), 2);$data['datasets'][1]['data'][] = round(($expense / $count), 2);+return $data;}}diff --git a/app/Helpers/Csv/Converter/ConverterInterface.php b/app/Helpers/Csv/Converter/ConverterInterface.phpindex aad4e3999a..f6a0cae84d 100644--- a/app/Helpers/Csv/Converter/ConverterInterface.php+++ b/app/Helpers/Csv/Converter/ConverterInterface.php@@ -15,6 +15,17 @@ interface ConverterInterface*/public function convert();+ /**+ * @param array $data+ */+ public function setData(array $data);++ /**+ * @param string $field+ *+ */+ public function setField($field);+/*** @param int $index*/@@ -35,15 +46,4 @@ interface ConverterInterface*/public function setValue($value);- /**- * @param array $data- */- public function setData(array $data);-- /**- * @param string $field- *- */- public function setField($field);-}\ No newline at end of filediff --git a/app/Helpers/Csv/Converter/CurrencyCode.php b/app/Helpers/Csv/Converter/CurrencyCode.phpindex 2e0baf50d5..e416257f92 100644--- a/app/Helpers/Csv/Converter/CurrencyCode.php+++ b/app/Helpers/Csv/Converter/CurrencyCode.php@@ -1,6 +1,7 @@<?phpnamespace FireflyIII\Helpers\Csv\Converter;+use FireflyIII\Models\TransactionCurrency;/**diff --git a/app/Helpers/Csv/Converter/CurrencyName.php b/app/Helpers/Csv/Converter/CurrencyName.phpindex 8788de2397..09a1bad4c4 100644--- a/app/Helpers/Csv/Converter/CurrencyName.php+++ b/app/Helpers/Csv/Converter/CurrencyName.php@@ -1,6 +1,7 @@<?phpnamespace FireflyIII\Helpers\Csv\Converter;+use FireflyIII\Models\TransactionCurrency;/**diff --git a/app/Helpers/Csv/Mapper/AnyAccount.php b/app/Helpers/Csv/Mapper/AnyAccount.phpindex f42e64d071..36fe8b20ed 100644--- a/app/Helpers/Csv/Mapper/AnyAccount.php+++ b/app/Helpers/Csv/Mapper/AnyAccount.php@@ -20,7 +20,7 @@ class AnyAccount implements MapperInterface{$result = Auth::user()->accounts()->with('accountType')->orderBy('accounts.name', 'ASC')->get(['accounts.*']);- $list = [];+ $list = [];/** @var Account $account */foreach ($result as $account) {$list[$account->id] = $account->name . ' (' . $account->accountType->type . ')';diff --git a/app/Helpers/Csv/PostProcessing/Currency.php b/app/Helpers/Csv/PostProcessing/Currency.phpindex 66c77ef189..f985c6a881 100644--- a/app/Helpers/Csv/PostProcessing/Currency.php+++ b/app/Helpers/Csv/PostProcessing/Currency.php@@ -1,8 +1,9 @@<?phpnamespace FireflyIII\Helpers\Csv\PostProcessing;-use Preferences;+use FireflyIII\Models\TransactionCurrency;+use Preferences;/*** Class Currency@@ -23,8 +24,8 @@ class Currency implements PostProcessorInterface// fix currencyif (is_null($this->data['currency'])) {- $currencyPreference = Preferences::get('currencyPreference', 'EUR');- $this->data['currency'] = TransactionCurrency::whereCode($currencyPreference->data)->first();+ $currencyPreference = Preferences::get('currencyPreference', 'EUR');+ $this->data['currency'] = TransactionCurrency::whereCode($currencyPreference->data)->first();}return $this->data;diff --git a/app/Helpers/Csv/PostProcessing/PostProcessorInterface.php b/app/Helpers/Csv/PostProcessing/PostProcessorInterface.phpindex dc2b04e64c..88a8ad1da7 100644--- a/app/Helpers/Csv/PostProcessing/PostProcessorInterface.php+++ b/app/Helpers/Csv/PostProcessing/PostProcessorInterface.php@@ -14,15 +14,16 @@ namespace FireflyIII\Helpers\Csv\PostProcessing;** @package FireflyIII\Helpers\Csv\PostProcessing*/-interface PostProcessorInterface {+interface PostProcessorInterface+{/**- * @param array $data+ * @return array*/- public function setData(array $data);+ public function process();/**- * @return array+ * @param array $data*/- public function process();+ public function setData(array $data);}\ No newline at end of filediff --git a/app/Helpers/Csv/Wizard.php b/app/Helpers/Csv/Wizard.phpindex 92291e7f45..a443fa06f1 100644--- a/app/Helpers/Csv/Wizard.php+++ b/app/Helpers/Csv/Wizard.php@@ -129,7 +129,7 @@ class Wizard implements WizardInterface*/public function showOptions(array $map){- $options = [];+ $options = [];foreach ($map as $index => $columnRole) {$mapper = Config::get('csv.roles.' . $columnRole . '.mapper');diff --git a/app/Helpers/Csv/WizardInterface.php b/app/Helpers/Csv/WizardInterface.phpindex bd938ad248..bd86a21495 100644--- a/app/Helpers/Csv/WizardInterface.php+++ b/app/Helpers/Csv/WizardInterface.php@@ -1,6 +1,7 @@<?phpnamespace FireflyIII\Helpers\Csv;+use League\Csv\Reader;/**diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.phpindex 1e2d0ce3c3..279fe60765 100644--- a/app/Models/AccountMeta.php+++ b/app/Models/AccountMeta.php@@ -6,7 +6,7 @@ use Watson\Validating\ValidatingTrait;/*** Class AccountMeta*- * @codeCoverageIgnore+ * @codeCoverageIgnore* @package FireflyIII\Models* @property integer $id* @property \Carbon\Carbon $created_atdiff --git a/app/Models/AccountType.php b/app/Models/AccountType.phpindex 6de461749b..2148b9e961 100644--- a/app/Models/AccountType.php+++ b/app/Models/AccountType.php@@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model;/*** Class AccountType*- * @codeCoverageIgnore+ * @codeCoverageIgnore* @package FireflyIII\Models* @property integer $id* @property \Carbon\Carbon $created_atdiff --git a/app/Models/Bill.php b/app/Models/Bill.phpindex 4cc50a19da..76ce0b66ad 100644--- a/app/Models/Bill.php+++ b/app/Models/Bill.php@@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model;* FireflyIII\Models\Bill** @codeCoverageIgnore Class Bill- * @package FireflyIII\Models+ * @package FireflyIII\Models* @property integer $id* @property \Carbon\Carbon $created_at* @property \Carbon\Carbon $updated_atdiff --git a/app/Models/Budget.php b/app/Models/Budget.phpindex 96886037f0..f6a8f9ec04 100644--- a/app/Models/Budget.php+++ b/app/Models/Budget.php@@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;/*** Class Budget*- * @codeCoverageIgnore+ * @codeCoverageIgnore* @package FireflyIII\Models* @property integer $id* @property \Carbon\Carbon $created_at@@ -40,6 +40,7 @@ class Budget extends Model/*** @param array $fields* @SuppressWarnings(PHPMD.CyclomaticComplexity)+ ** @codeCoverageIgnore** @return Budgetdiff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.phpindex 97f2b16dab..42e72dc502 100644--- a/app/Models/BudgetLimit.php+++ b/app/Models/BudgetLimit.php@@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model;/*** Class BudgetLimit*- * @codeCoverageIgnore+ * @codeCoverageIgnore* @package FireflyIII\Models* @property integer $id* @property \Carbon\Carbon $created_atdiff --git a/app/Models/Component.php b/app/Models/Component.phpindex c65a9c8812..84686751be 100644--- a/app/Models/Component.php+++ b/app/Models/Component.php@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;/*** Class Component*- * @codeCoverageIgnore+ * @codeCoverageIgnore* @package FireflyIII\Models* @property integer $id* @property \Carbon\Carbon $created_atdiff --git a/app/Models/LimitRepetition.php b/app/Models/LimitRepetition.phpindex 5f6ea2a6cf..d5fd692dae 100644--- a/app/Models/LimitRepetition.php+++ b/app/Models/LimitRepetition.php@@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model;/*** Class LimitRepetition*- * @codeCoverageIgnore+ * @codeCoverageIgnore* @package FireflyIII\Models* @property integer $id* @property \Carbon\Carbon $created_atdiff --git a/app/Models/PiggyBank.php b/app/Models/PiggyBank.phpindex cdabb6d4e8..b2e1b09dbb 100644--- a/app/Models/PiggyBank.php+++ b/app/Models/PiggyBank.php@@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;/*** Class PiggyBank*- * @codeCoverageIgnore+ * @codeCoverageIgnore* @package FireflyIII\Models* @property integer $id* @property \Carbon\Carbon $created_at@@ -37,9 +37,9 @@ use Illuminate\Database\Eloquent\SoftDeletes;* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereOrder($value)* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereEncrypted($value)* @property PiggyBankRepetition currentRep- * @property string $reminder- * @property integer $reminder_skip- * @property boolean $remind_me+ * @property string $reminder+ * @property integer $reminder_skip+ * @property boolean $remind_me* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereReminder($value)* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereReminderSkip($value)* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereRemindMe($value)diff --git a/app/Models/PiggyBankEvent.php b/app/Models/PiggyBankEvent.phpindex 98de0f04ef..6b9bdceda1 100644--- a/app/Models/PiggyBankEvent.php+++ b/app/Models/PiggyBankEvent.php@@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model;/*** Class PiggyBankEvent*- * @codeCoverageIgnore+ * @codeCoverageIgnore* @package FireflyIII\Models* @property integer $id* @property \Carbon\Carbon $created_atdiff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.phpindex 68d2388acc..a24066f2ee 100644--- a/app/Models/PiggyBankRepetition.php+++ b/app/Models/PiggyBankRepetition.php@@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model;/*** Class PiggyBankRepetition*- * @codeCoverageIgnore+ * @codeCoverageIgnore* @package FireflyIII\Models* @property integer $id* @property \Carbon\Carbon $created_atdiff --git a/app/Models/Preference.php b/app/Models/Preference.phpindex 263e7e33bc..56bc6f7cfd 100644--- a/app/Models/Preference.php+++ b/app/Models/Preference.php@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;/*** Class Preference*- * @codeCoverageIgnore+ * @codeCoverageIgnore* @package FireflyIII\Models* @property integer $id* @property \Carbon\Carbon $created_atdiff --git a/app/Models/Transaction.php b/app/Models/Transaction.phpindex 43f9928439..26ca48ef45 100644--- a/app/Models/Transaction.php+++ b/app/Models/Transaction.php@@ -9,7 +9,7 @@ use Watson\Validating\ValidatingTrait;/*** Class Transaction*- * @codeCoverageIgnore+ * @codeCoverageIgnore* @package FireflyIII\Models* @property integer $id* @property \Carbon\Carbon $created_atdiff --git a/app/Models/TransactionCurrency.php b/app/Models/TransactionCurrency.phpindex 4adad9b216..27b21f36c3 100644--- a/app/Models/TransactionCurrency.php+++ b/app/Models/TransactionCurrency.php@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;/*** Class TransactionCurrency*- * @codeCoverageIgnore+ * @codeCoverageIgnore* @package FireflyIII\Models* @property integer $id* @property \Carbon\Carbon $created_atdiff --git a/app/Models/TransactionGroup.php b/app/Models/TransactionGroup.phpindex 6c980bfac0..bb41749ca2 100644--- a/app/Models/TransactionGroup.php+++ b/app/Models/TransactionGroup.php@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;/*** Class TransactionGroup*- * @codeCoverageIgnore+ * @codeCoverageIgnore* @package FireflyIII\Models* @property integer $id* @property \Carbon\Carbon $created_atdiff --git a/app/Models/TransactionRelation.php b/app/Models/TransactionRelation.phpindex 056d61fdd8..aa4d3810af 100644--- a/app/Models/TransactionRelation.php+++ b/app/Models/TransactionRelation.php@@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model;/*** Class TransactionRelation*- * @codeCoverageIgnore+ * @codeCoverageIgnore* @package FireflyIII\Models*/class TransactionRelation extends Modeldiff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.phpindex 886858bb2c..098d5bcfc7 100644--- a/app/Models/TransactionType.php+++ b/app/Models/TransactionType.php@@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;/*** Class TransactionType*- * @codeCoverageIgnore+ * @codeCoverageIgnore* @package FireflyIII\Models* @property integer $id* @property \Carbon\Carbon $created_atdiff --git a/app/Support/Navigation.php b/app/Support/Navigation.phpindex 2f3c15fe8c..d22b0250e6 100644--- a/app/Support/Navigation.php+++ b/app/Support/Navigation.php@@ -83,7 +83,7 @@ class Navigation$subDay = ['week', 'weekly', '1W', 'month', 'monthly', '1M', '3M', 'quarter', 'quarterly', '6M', 'half-year', 'year', 'yearly'];if (!isset($functionMap[$repeatFreq])) {- throw new FireflyException('Cannot do endOfPeriod for $repeat_freq "' . $repeatFreq.'"');+ throw new FireflyException('Cannot do endOfPeriod for $repeat_freq "' . $repeatFreq . '"');}$function = $functionMap[$repeatFreq];if (isset($modifierMap[$repeatFreq])) {@@ -204,7 +204,7 @@ class Navigationreturn $date;}- throw new FireflyException('Cannot do startOfPeriod for $repeat_freq "' . $repeatFreq.'"');+ throw new FireflyException('Cannot do startOfPeriod for $repeat_freq "' . $repeatFreq . '"');}/**@@ -246,7 +246,7 @@ class Navigationreturn $date;}- throw new FireflyException('Cannot do subtractPeriod for $repeat_freq "' . $repeatFreq.'"');+ throw new FireflyException('Cannot do subtractPeriod for $repeat_freq "' . $repeatFreq . '"');}/**@@ -282,7 +282,7 @@ class Navigationreturn $end;}- throw new FireflyException('updateEndDate cannot handle $range "' . $range.'"');+ throw new FireflyException('updateEndDate cannot handle $range "' . $range . '"');}/**@@ -316,7 +316,7 @@ class Navigationreturn $start;}- throw new FireflyException('updateStartDate cannot handle $range "' . $range.'"');+ throw new FireflyException('updateStartDate cannot handle $range "' . $range . '"');}diff --git a/app/User.php b/app/User.phpindex 0763ff9e56..431731aa0c 100644--- a/app/User.php+++ b/app/User.php@@ -10,7 +10,7 @@ use Zizaco\Entrust\Traits\EntrustUserTrait;/*** Class User*- * @codeCoverageIgnore+ * @codeCoverageIgnore* @package FireflyIII* @property integer $id* @property \Carbon\Carbon $created_at