Code cleanup.

This commit is contained in:
James Cole
2015-05-05 10:23:01 +02:00
parent 67fdd27499
commit 23a09b7081
37 changed files with 112 additions and 62 deletions

View File

@@ -374,6 +374,8 @@ class AccountRepository implements AccountRepositoryInterface
/**
* @param Account $account
* @param array $data
*
* @return Account
*/
public function update(Account $account, array $data)
{

View File

@@ -88,7 +88,7 @@ interface AccountRepositoryInterface
/**
* @param Account $account
* @param string $range
* @param $page
*
* @return LengthAwarePaginator
*/

View File

@@ -211,10 +211,12 @@ class BillRepository implements BillRepositoryInterface
* $today is the start of the next period, to make sure FF3 won't miss anything
* when the current period has a transaction journal.
*/
$today = Navigation::addPeriod(new Carbon, $bill->repeat_freq, 0);
/** @var \Carbon\Carbon $obj */
$obj = new Carbon;
$today = Navigation::addPeriod($obj, $bill->repeat_freq, 0);
$skip = $bill->skip + 1;
$start = Navigation::startOfPeriod(new Carbon, $bill->repeat_freq);
$start = Navigation::startOfPeriod($obj, $bill->repeat_freq);
/*
* go back exactly one month/week/etc because FF3 does not care about 'next'
* bills if they're too far into the past.

View File

@@ -72,8 +72,8 @@ interface CategoryRepositoryInterface
/**
* @param Category $category
* @param Carbon $start
* @param Carbon $end
* @param \Carbon\Carbon $start
* @param \Carbon\Carbon $end
*
* @return float
*/

View File

@@ -27,13 +27,13 @@ class JournalRepository implements JournalRepositoryInterface
{
/**
* @param int $id
* @param int $reminderId
*
* @return bool
*/
public function deactivateReminder($id)
public function deactivateReminder($reminderId)
{
$reminder = Auth::user()->reminders()->find($id);
$reminder = Auth::user()->reminders()->find($reminderId);
if ($reminder) {
$reminder->active = 0;
$reminder->save();
@@ -195,6 +195,7 @@ class JournalRepository implements JournalRepositoryInterface
// store or get budget
if (intval($data['budget_id']) > 0) {
/** @var \FireflyIII\Models\Budget $budget */
$budget = Budget::find($data['budget_id']);
$journal->budgets()->save($budget);
}
@@ -254,6 +255,7 @@ class JournalRepository implements JournalRepositoryInterface
// unlink all budgets and recreate them:
$journal->budgets()->detach();
if (intval($data['budget_id']) > 0) {
/** @var \FireflyIII\Models\Budget $budget */
$budget = Budget::find($data['budget_id']);
$journal->budgets()->save($budget);
}

View File

@@ -17,11 +17,11 @@ use Illuminate\Support\Collection;
interface JournalRepositoryInterface
{
/**
* @param int $id
* @param int $reminderId
*
* @return bool
*/
public function deactivateReminder($id);
public function deactivateReminder($reminderId);
/**
* @param TransactionJournal $journal

View File

@@ -188,10 +188,11 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
}
/**
* @param PiggyBank $account
* @param PiggyBank $piggyBank
* @param array $data
*
* @return PiggyBank
* @internal param PiggyBank $account
*/
public function update(PiggyBank $piggyBank, array $data)
{

View File

@@ -94,7 +94,7 @@ interface PiggyBankRepositoryInterface
public function store(array $data);
/**
* @param PiggyBank $account
* @param PiggyBank $piggyBank
* @param array $data
*
* @return PiggyBank