Various cleanup and spelling fixes.

This commit is contained in:
James Cole
2014-12-25 08:07:17 +01:00
parent 230bd6e40a
commit 1659904f81
7 changed files with 47 additions and 24 deletions

View File

@@ -61,6 +61,8 @@ class CurrencyController extends BaseController
/** /**
* @param TransactionCurrency $currency * @param TransactionCurrency $currency
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
*/ */
public function delete(TransactionCurrency $currency) public function delete(TransactionCurrency $currency)
{ {
@@ -74,6 +76,11 @@ class CurrencyController extends BaseController
return View::make('currency.delete', compact('currency')); return View::make('currency.delete', compact('currency'));
} }
/**
* @param TransactionCurrency $currency
*
* @return \Illuminate\Http\RedirectResponse
*/
public function destroy(TransactionCurrency $currency) public function destroy(TransactionCurrency $currency)
{ {
Session::flash('success', 'Currency "' . e($currency->name) . '" deleted'); Session::flash('success', 'Currency "' . e($currency->name) . '" deleted');
@@ -98,6 +105,9 @@ class CurrencyController extends BaseController
} }
/**
* @return \Illuminate\View\View
*/
public function index() public function index()
{ {
$currencies = $this->_repository->get(); $currencies = $this->_repository->get();
@@ -112,6 +122,9 @@ class CurrencyController extends BaseController
return View::make('currency.index', compact('currencies', 'defaultCurrency')); return View::make('currency.index', compact('currencies', 'defaultCurrency'));
} }
/**
* @return $this|\Illuminate\Http\RedirectResponse
*/
public function store() public function store()
{ {
$data = Input::except('_token'); $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) public function update(TransactionCurrency $currency)
{ {
$data = Input::except('_token'); $data = Input::except('_token');

View File

@@ -235,8 +235,8 @@ class GoogleChartController extends BaseController
return View::make('error')->with('message', 'Invalid year.'); return View::make('error')->with('message', 'Invalid year.');
} }
/** @var \FireflyIII\Database\Budget\Budget $repos */ /** @var \FireflyIII\Database\Budget\Budget $budgetRepository */
$repos = App::make('FireflyIII\Database\Budget\Budget'); $budgetRepository = App::make('FireflyIII\Database\Budget\Budget');
$this->_chart->addColumn('Month', 'date'); $this->_chart->addColumn('Month', 'date');
$this->_chart->addColumn('Budgeted', 'number'); $this->_chart->addColumn('Budgeted', 'number');
@@ -246,8 +246,8 @@ class GoogleChartController extends BaseController
$end = clone $start; $end = clone $start;
$end->endOfYear(); $end->endOfYear();
while ($start <= $end) { while ($start <= $end) {
$spent = $repos->spentInMonth($component, $start); $spent = $budgetRepository->spentInMonth($component, $start);
$repetition = $repos->repetitionOnStartingOnDate($component, $start); $repetition = $budgetRepository->repetitionOnStartingOnDate($component, $start);
if ($repetition) { if ($repetition) {
$budgeted = floatval($repetition->amount); $budgeted = floatval($repetition->amount);
} else { } else {
@@ -283,8 +283,8 @@ class GoogleChartController extends BaseController
return View::make('error')->with('message', 'Invalid year.'); return View::make('error')->with('message', 'Invalid year.');
} }
/** @var \FireflyIII\Database\Category\Category $repos */ /** @var \FireflyIII\Database\Category\Category $categoryRepository */
$repos = App::make('FireflyIII\Database\Category\Category'); $categoryRepository = App::make('FireflyIII\Database\Category\Category');
$this->_chart->addColumn('Month', 'date'); $this->_chart->addColumn('Month', 'date');
$this->_chart->addColumn('Budgeted', 'number'); $this->_chart->addColumn('Budgeted', 'number');
@@ -295,7 +295,7 @@ class GoogleChartController extends BaseController
$end->endOfYear(); $end->endOfYear();
while ($start <= $end) { while ($start <= $end) {
$spent = $repos->spentInMonth($component, $start); $spent = $categoryRepository->spentInMonth($component, $start);
$budgeted = null; $budgeted = null;
$this->_chart->addRow(clone $start, $budgeted, $spent); $this->_chart->addRow(clone $start, $budgeted, $spent);

View File

@@ -26,8 +26,8 @@ class HomeController extends BaseController
/** @var \FireflyIII\Database\Account\Account $acct */ /** @var \FireflyIII\Database\Account\Account $acct */
$acct = App::make('FireflyIII\Database\Account\Account'); $acct = App::make('FireflyIII\Database\Account\Account');
/** @var \FireflyIII\Database\TransactionJournal\TransactionJournal $jrnls */ /** @var \FireflyIII\Database\TransactionJournal\TransactionJournal $journalRepository */
$jrnls = App::make('FireflyIII\Database\TransactionJournal\TransactionJournal'); $journalRepository = App::make('FireflyIII\Database\TransactionJournal\TransactionJournal');
/** @var \FireflyIII\Shared\Preferences\PreferencesInterface $preferences */ /** @var \FireflyIII\Shared\Preferences\PreferencesInterface $preferences */
$preferences = App::make('FireflyIII\Shared\Preferences\PreferencesInterface'); $preferences = App::make('FireflyIII\Shared\Preferences\PreferencesInterface');
@@ -39,16 +39,16 @@ class HomeController extends BaseController
// get the preference for the home accounts to show: // get the preference for the home accounts to show:
$frontpage = $preferences->get('frontPageAccounts', []); $frontPage = $preferences->get('frontPageAccounts', []);
if ($frontpage->data == []) { if ($frontPage->data == []) {
$accounts = $acct->getAssetAccounts(); $accounts = $acct->getAssetAccounts();
} else { } else {
$accounts = $acct->getByIds($frontpage->data); $accounts = $acct->getByIds($frontPage->data);
} }
$transactions = []; $transactions = [];
foreach ($accounts as $account) { foreach ($accounts as $account) {
$set = $jrnls->getInDateRangeAccount($account, $start, $end, 10); $set = $journalRepository->getInDateRangeAccount($account, $start, $end, 10);
if (count($set) > 0) { if (count($set) > 0) {
$transactions[] = [$set, $account]; $transactions[] = [$set, $account];
} }

View File

@@ -182,9 +182,9 @@ class PiggyBankController extends BaseController
$amount = round(floatval(Input::get('amount')), 2); $amount = round(floatval(Input::get('amount')), 2);
/** @var \FireflyIII\Database\PiggyBank\PiggyBank $acct */ /** @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; $savedSoFar = $piggyBank->currentRelevantRep()->currentamount;
$leftToSave = $piggyBank->targetamount - $savedSoFar; $leftToSave = $piggyBank->targetamount - $savedSoFar;
$maxAmount = round(min($leftOnAccount, $leftToSave), 2); $maxAmount = round(min($leftOnAccount, $leftToSave), 2);
@@ -243,7 +243,7 @@ class PiggyBankController extends BaseController
*/ */
public function remove(PiggyBank $piggyBank) public function remove(PiggyBank $piggyBank)
{ {
return View::make('piggy_banks.remove',compact('piggyBank')); return View::make('piggy_banks.remove', compact('piggyBank'));
} }
/** /**

View File

@@ -1,6 +1,8 @@
<?php <?php
/** /**
* @SuppressWarnings("CyclomaticComplexity") // It's all 5. So ok.
*
* Class ProfileController * Class ProfileController
*/ */
class ProfileController extends BaseController class ProfileController extends BaseController

View File

@@ -3,6 +3,10 @@ use FireflyIII\Database\RecurringTransaction\RecurringTransaction as Repository;
use FireflyIII\Exception\FireflyException; use FireflyIII\Exception\FireflyException;
/** /**
*
* @SuppressWarnings("CamelCase") // I'm fine with this.
* @SuppressWarnings("CyclomaticComplexity") // It's all 5. So ok.
* @SuppressWarnings("NPathComplexity")
* Class RecurringController * Class RecurringController
* *
*/ */
@@ -114,7 +118,7 @@ class RecurringController extends BaseController
$hideRecurring = true; $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 'subTitle', $recurringTransaction->name
); );
} }

View File

@@ -2,7 +2,6 @@
namespace FireflyIII\Shared\Toolkit; namespace FireflyIII\Shared\Toolkit;
use Illuminate\Support\Collection;
/** /**
* Class Form * Class Form
@@ -14,12 +13,12 @@ class Form
/** /**
* Takes any collection and tries to make a sensible select list compatible array of it. * Takes any collection and tries to make a sensible select list compatible array of it.
* *
* @param Collection $set * @param \Illuminate\Support\Collection $set
* @param bool $addEmpty * @param bool $addEmpty
* *
* @return mixed * @return mixed
*/ */
public function makeSelectList(Collection $set, $addEmpty = false) public function makeSelectList(\Illuminate\Support\Collection $set, $addEmpty = false)
{ {
$selectList = []; $selectList = [];
if ($addEmpty) { if ($addEmpty) {