More spelling checks and small clean ups.

This commit is contained in:
James Cole
2014-12-31 17:15:59 +01:00
parent 6fa73ee28d
commit 3386c8b455
10 changed files with 20 additions and 15 deletions

View File

@@ -514,14 +514,14 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
*/
public function firstExpenseAccountOrCreate($name)
{
/** @var \FireflyIII\Database\AccountType\AccountType $accountTypeRepos */
$accountTypeRepos = \App::make('FireflyIII\Database\AccountType\AccountType');
/** @var \FireflyIII\Database\AccountType\AccountType $accountTypeRepository */
$accountTypeRepository = \App::make('FireflyIII\Database\AccountType\AccountType');
$accountType = $accountTypeRepos->findByWhat('expense');
$accountType = $accountTypeRepository->findByWhat('expense');
// if name is "", find cash account:
if (strlen($name) == 0) {
$cashAccountType = $accountTypeRepos->findByWhat('cash');
$cashAccountType = $accountTypeRepository->findByWhat('cash');
// find or create cash account:
return \Account::firstOrCreate(
@@ -543,10 +543,10 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
*/
public function firstRevenueAccountOrCreate($name)
{
/** @var \FireflyIII\Database\AccountType\AccountType $accountTypeRepos */
$accountTypeRepos = \App::make('FireflyIII\Database\AccountType\AccountType');
/** @var \FireflyIII\Database\AccountType\AccountType $accountTypeRepository */
$accountTypeRepository = \App::make('FireflyIII\Database\AccountType\AccountType');
$accountType = $accountTypeRepos->findByWhat('revenue');
$accountType = $accountTypeRepository->findByWhat('revenue');
$data = ['user_id' => $this->getUser()->id, 'account_type_id' => $accountType->id, 'name' => $name, 'active' => 1];

View File

@@ -237,7 +237,7 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
}
/**
* This method includes the time because otherwise, SQLite doesn't understand it.
* This method includes the time because otherwise, SQLite does not understand it.
*
* @param \Budget $budget
* @param Carbon $date

View File

@@ -94,6 +94,7 @@ class TransactionCurrency implements TransactionCurrencyInterface, CommonDatabas
* Returns an object with id $id.
*
* @param int $objectId
* @throws NotImplementedException
*
* @return \Eloquent
*/
@@ -107,6 +108,7 @@ class TransactionCurrency implements TransactionCurrencyInterface, CommonDatabas
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
*
* @param $what
* @throws NotImplementedException
*
* @return \AccountType|null
*/
@@ -128,6 +130,7 @@ class TransactionCurrency implements TransactionCurrencyInterface, CommonDatabas
/**
* @param array $objectIds
* @throws NotImplementedException
*
* @return Collection
*/

View File

@@ -590,8 +590,8 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
// get already related transactions:
$exclude = [$journal->id];
foreach ($journal->transactiongroups()->get() as $group) {
foreach ($group->transactionjournals() as $jrnl) {
$exclude[] = $jrnl->id;
foreach ($group->transactionjournals() as $current) {
$exclude[] = $current->id;
}
}
$exclude = array_unique($exclude);

View File

@@ -203,7 +203,7 @@ class PiggyBank
$repetition->currentamount = 0;
$repetition->save();
}
// then continue and do something in the current relevant timeframe.
// then continue and do something in the current relevant time frame.
$currentTarget = clone $target;
$currentStart = null;

View File

@@ -34,6 +34,7 @@ class Report implements ReportInterface
/**
* @param AccountRepository $accounts
* @param JournalRepository $journals
*/
public function __construct(AccountRepository $accounts, JournalRepository $journals)
{

View File

@@ -45,7 +45,7 @@ class ReportHelper implements ReportHelperInterface
/**
* Turns a collection into an array. Needs the field 'id' for the key,
* and saves only 'name' and 'amount' as a subarray.
* and saves only 'name' and 'amount' as a sub array.
*
* @param Collection $collection
*

View File

@@ -25,7 +25,7 @@ interface ReportHelperInterface
/**
* Turns a collection into an array. Needs the field 'id' for the key,
* and saves 'name', 'amount','spent' (if present) as a subarray.
* and saves 'name', 'amount','spent' (if present) as a sub array.
*
* @param Collection $collection
*

View File

@@ -55,7 +55,7 @@ class Navigation
$start = \Session::get('start', Carbon::now()->startOfMonth());
/*
* Substract some period to $start.
* Subtract some period to $start.
*/
$prev = $filter->previous($range, clone $start);

View File

@@ -1,6 +1,7 @@
<?php
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model as Eloquent;
use Illuminate\Database\Eloquent\SoftDeletingTrait;
use Watson\Validating\ValidatingTrait;
/**
@@ -8,7 +9,7 @@ use Watson\Validating\ValidatingTrait;
*/
class PiggyBank extends Eloquent
{
use ValidatingTrait;
use ValidatingTrait, SoftDeletingTrait;
public $fillable
= ['account_id', 'name', 'targetamount', 'startdate', 'targetdate', 'repeats', 'rep_length', 'rep_every', 'rep_times', 'reminder', 'reminder_skip',
'remind_me', 'order'];