Skip to content

Firefly III: a personal finances manager

Various cleanup and spelling fixes.

James Cole1659904f8154
diff --git a/app/controllers/CurrencyController.php b/app/controllers/CurrencyController.php
index bc2ae575ea..9daadad525 100644
--- a/app/controllers/CurrencyController.php
+++ b/app/controllers/CurrencyController.php
@@ -61,6 +61,8 @@ class CurrencyController extends BaseController
/**
* @param TransactionCurrency $currency
+ *
+ * @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
*/
public function delete(TransactionCurrency $currency)
{
@@ -74,6 +76,11 @@ class CurrencyController extends BaseController
return View::make('currency.delete', compact('currency'));
}
+ /**
+ * @param TransactionCurrency $currency
+ *
+ * @return \Illuminate\Http\RedirectResponse
+ */
public function destroy(TransactionCurrency $currency)
{
Session::flash('success', 'Currency "' . e($currency->name) . '" deleted');
@@ -98,6 +105,9 @@ class CurrencyController extends BaseController
}
+ /**
+ * @return \Illuminate\View\View
+ */
public function index()
{
$currencies = $this->_repository->get();
@@ -112,6 +122,9 @@ class CurrencyController extends BaseController
return View::make('currency.index', compact('currencies', 'defaultCurrency'));
}
+ /**
+ * @return $this|\Illuminate\Http\RedirectResponse
+ */
public function store()
{
$data = Input::except('_token');
@@ -143,6 +156,11 @@ class CurrencyController extends BaseController
}
+ /**
+ * @param TransactionCurrency $currency
+ *
+ * @return $this|\Illuminate\Http\RedirectResponse
+ */
public function update(TransactionCurrency $currency)
{
$data = Input::except('_token');
diff --git a/app/controllers/GoogleChartController.php b/app/controllers/GoogleChartController.php
index d0be292c29..fcb2c8884b 100644
--- a/app/controllers/GoogleChartController.php
+++ b/app/controllers/GoogleChartController.php
@@ -235,8 +235,8 @@ class GoogleChartController extends BaseController
return View::make('error')->with('message', 'Invalid year.');
}
- /** @var \FireflyIII\Database\Budget\Budget $repos */
- $repos = App::make('FireflyIII\Database\Budget\Budget');
+ /** @var \FireflyIII\Database\Budget\Budget $budgetRepository */
+ $budgetRepository = App::make('FireflyIII\Database\Budget\Budget');
$this->_chart->addColumn('Month', 'date');
$this->_chart->addColumn('Budgeted', 'number');
@@ -246,8 +246,8 @@ class GoogleChartController extends BaseController
$end = clone $start;
$end->endOfYear();
while ($start <= $end) {
- $spent = $repos->spentInMonth($component, $start);
- $repetition = $repos->repetitionOnStartingOnDate($component, $start);
+ $spent = $budgetRepository->spentInMonth($component, $start);
+ $repetition = $budgetRepository->repetitionOnStartingOnDate($component, $start);
if ($repetition) {
$budgeted = floatval($repetition->amount);
} else {
@@ -283,8 +283,8 @@ class GoogleChartController extends BaseController
return View::make('error')->with('message', 'Invalid year.');
}
- /** @var \FireflyIII\Database\Category\Category $repos */
- $repos = App::make('FireflyIII\Database\Category\Category');
+ /** @var \FireflyIII\Database\Category\Category $categoryRepository */
+ $categoryRepository = App::make('FireflyIII\Database\Category\Category');
$this->_chart->addColumn('Month', 'date');
$this->_chart->addColumn('Budgeted', 'number');
@@ -295,7 +295,7 @@ class GoogleChartController extends BaseController
$end->endOfYear();
while ($start <= $end) {
- $spent = $repos->spentInMonth($component, $start);
+ $spent = $categoryRepository->spentInMonth($component, $start);
$budgeted = null;
$this->_chart->addRow(clone $start, $budgeted, $spent);
diff --git a/app/controllers/HomeController.php b/app/controllers/HomeController.php
index 4470615afb..163a3bce99 100644
--- a/app/controllers/HomeController.php
+++ b/app/controllers/HomeController.php
@@ -26,8 +26,8 @@ class HomeController extends BaseController
/** @var \FireflyIII\Database\Account\Account $acct */
$acct = App::make('FireflyIII\Database\Account\Account');
- /** @var \FireflyIII\Database\TransactionJournal\TransactionJournal $jrnls */
- $jrnls = App::make('FireflyIII\Database\TransactionJournal\TransactionJournal');
+ /** @var \FireflyIII\Database\TransactionJournal\TransactionJournal $journalRepository */
+ $journalRepository = App::make('FireflyIII\Database\TransactionJournal\TransactionJournal');
/** @var \FireflyIII\Shared\Preferences\PreferencesInterface $preferences */
$preferences = App::make('FireflyIII\Shared\Preferences\PreferencesInterface');
@@ -39,16 +39,16 @@ class HomeController extends BaseController
// get the preference for the home accounts to show:
- $frontpage = $preferences->get('frontPageAccounts', []);
- if ($frontpage->data == []) {
+ $frontPage = $preferences->get('frontPageAccounts', []);
+ if ($frontPage->data == []) {
$accounts = $acct->getAssetAccounts();
} else {
- $accounts = $acct->getByIds($frontpage->data);
+ $accounts = $acct->getByIds($frontPage->data);
}
$transactions = [];
foreach ($accounts as $account) {
- $set = $jrnls->getInDateRangeAccount($account, $start, $end, 10);
+ $set = $journalRepository->getInDateRangeAccount($account, $start, $end, 10);
if (count($set) > 0) {
$transactions[] = [$set, $account];
}
diff --git a/app/controllers/PiggybankController.php b/app/controllers/PiggybankController.php
index 3e662323ae..e08cef2f62 100644
--- a/app/controllers/PiggybankController.php
+++ b/app/controllers/PiggybankController.php
@@ -42,9 +42,9 @@ class PiggyBankController extends BaseController
public function add(PiggyBank $piggyBank)
{
$leftOnAccount = $this->_repository->leftOnAccount($piggyBank->account);
- $savedSoFar = $piggyBank->currentRelevantRep()->currentamount;
- $leftToSave = $piggyBank->targetamount - $savedSoFar;
- $maxAmount = min($leftOnAccount, $leftToSave);
+ $savedSoFar = $piggyBank->currentRelevantRep()->currentamount;
+ $leftToSave = $piggyBank->targetamount - $savedSoFar;
+ $maxAmount = min($leftOnAccount, $leftToSave);
\Log::debug('Now going to view for piggy bank #' . $piggyBank->id . ' (' . $piggyBank->name . ')');
@@ -182,9 +182,9 @@ class PiggyBankController extends BaseController
$amount = round(floatval(Input::get('amount')), 2);
/** @var \FireflyIII\Database\PiggyBank\PiggyBank $acct */
- $repos = App::make('FireflyIII\Database\PiggyBank\PiggyBank');
+ $piggyRepository = App::make('FireflyIII\Database\PiggyBank\PiggyBank');
- $leftOnAccount = $repos->leftOnAccount($piggyBank->account);
+ $leftOnAccount = $piggyRepository->leftOnAccount($piggyBank->account);
$savedSoFar = $piggyBank->currentRelevantRep()->currentamount;
$leftToSave = $piggyBank->targetamount - $savedSoFar;
$maxAmount = round(min($leftOnAccount, $leftToSave), 2);
@@ -243,7 +243,7 @@ class PiggyBankController extends BaseController
*/
public function remove(PiggyBank $piggyBank)
{
- return View::make('piggy_banks.remove',compact('piggyBank'));
+ return View::make('piggy_banks.remove', compact('piggyBank'));
}
/**
diff --git a/app/controllers/ProfileController.php b/app/controllers/ProfileController.php
index d5373ec0c5..19ca37ec0c 100644
--- a/app/controllers/ProfileController.php
+++ b/app/controllers/ProfileController.php
@@ -1,6 +1,8 @@
<?php
/**
+ * @SuppressWarnings("CyclomaticComplexity") // It's all 5. So ok.
+ *
* Class ProfileController
*/
class ProfileController extends BaseController
diff --git a/app/controllers/RecurringController.php b/app/controllers/RecurringController.php
index 01bb85db08..4b7f094dd7 100644
--- a/app/controllers/RecurringController.php
+++ b/app/controllers/RecurringController.php
@@ -3,6 +3,10 @@ use FireflyIII\Database\RecurringTransaction\RecurringTransaction as Repository;
use FireflyIII\Exception\FireflyException;
/**
+ *
+ * @SuppressWarnings("CamelCase") // I'm fine with this.
+ * @SuppressWarnings("CyclomaticComplexity") // It's all 5. So ok.
+ * @SuppressWarnings("NPathComplexity")
* Class RecurringController
*
*/
@@ -114,7 +118,7 @@ class RecurringController extends BaseController
$hideRecurring = true;
- return View::make('recurring.show', compact('journals', 'hideRecurring', 'finalDate'))->with('recurring', $recurringTransaction)->with(
+ return View::make('recurring.show', compact('journals', 'hideRecurring'))->with('recurring', $recurringTransaction)->with(
'subTitle', $recurringTransaction->name
);
}
diff --git a/app/lib/FireflyIII/Shared/Toolkit/Form.php b/app/lib/FireflyIII/Shared/Toolkit/Form.php
index 036257fb1a..42d6270009 100644
--- a/app/lib/FireflyIII/Shared/Toolkit/Form.php
+++ b/app/lib/FireflyIII/Shared/Toolkit/Form.php
@@ -2,7 +2,6 @@
namespace FireflyIII\Shared\Toolkit;
-use Illuminate\Support\Collection;
/**
* Class Form
@@ -14,12 +13,12 @@ class Form
/**
* Takes any collection and tries to make a sensible select list compatible array of it.
*
- * @param Collection $set
- * @param bool $addEmpty
+ * @param \Illuminate\Support\Collection $set
+ * @param bool $addEmpty
*
* @return mixed
*/
- public function makeSelectList(Collection $set, $addEmpty = false)
+ public function makeSelectList(\Illuminate\Support\Collection $set, $addEmpty = false)
{
$selectList = [];
if ($addEmpty) {