Code cleanup before release.

This commit is contained in:
James Cole
2018-03-29 19:01:47 +02:00
parent 40266c6821
commit 170d23d768
76 changed files with 181 additions and 171 deletions

View File

@@ -235,6 +235,7 @@ class AccountRepository implements AccountRepositoryInterface
/**
* Returns the date of the very first transaction in this account.
* TODO refactor to nullable.
*
* @param Account $account
*
@@ -242,12 +243,13 @@ class AccountRepository implements AccountRepositoryInterface
*/
public function oldestJournalDate(Account $account): Carbon
{
$result = new Carbon;
$journal = $this->oldestJournal($account);
if (null === $journal->id) {
return new Carbon;
if (null !== $journal->id) {
$result = $journal->date;
}
return $journal->date;
return $result;
}
/**
@@ -262,6 +264,8 @@ class AccountRepository implements AccountRepositoryInterface
* @param array $data
*
* @return Account
* @throws \FireflyIII\Exceptions\FireflyException
* @throws \FireflyIII\Exceptions\FireflyException
*/
public function store(array $data): Account
{
@@ -278,6 +282,8 @@ class AccountRepository implements AccountRepositoryInterface
* @param array $data
*
* @return Account
* @throws \FireflyIII\Exceptions\FireflyException
* @throws \FireflyIII\Exceptions\FireflyException
*/
public function update(Account $account, array $data): Account
{