Various code cleanup.

This commit is contained in:
James Cole
2017-02-25 05:57:01 +01:00
parent 444439fdab
commit 8c6972d12d
35 changed files with 133 additions and 171 deletions

View File

@@ -457,7 +457,8 @@ class AccountRepository implements AccountRepositoryInterface
$name = $data['name'];
$opposing = $this->storeOpposingAccount($name);
$transactionType = TransactionType::whereType(TransactionType::OPENING_BALANCE)->first();
$journal = TransactionJournal::create(
/** @var TransactionJournal $journal */
$journal = TransactionJournal::create(
[
'user_id' => $this->user->id,
'transaction_type_id' => $transactionType->id,

View File

@@ -525,8 +525,7 @@ class BillRepository implements BillRepositoryInterface
*/
public function store(array $data): Bill
{
/** @var Bill $bill */
$bill = Bill::create(
[
'name' => $data['name'],

View File

@@ -193,6 +193,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
*/
public function store(array $data): TransactionCurrency
{
/** @var TransactionCurrency $currency */
$currency = TransactionCurrency::create(
[
'name' => $data['name'],

View File

@@ -40,6 +40,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
*/
public function createEvent(PiggyBank $piggyBank, string $amount): PiggyBankEvent
{
/** @var PiggyBankEvent $event */
$event = PiggyBankEvent::create(['date' => Carbon::now(), 'amount' => $amount, 'piggy_bank_id' => $piggyBank->id]);
return $event;
@@ -173,7 +174,8 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
public function store(array $data): PiggyBank
{
$data['order'] = $this->getMaxOrder() + 1;
$piggyBank = PiggyBank::create($data);
/** @var PiggyBank $piggyBank */
$piggyBank = PiggyBank::create($data);
$this->updateNote($piggyBank, $data['note']);