mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 14:48:11 +00:00
apply demeter law for transaction type calls
- adds contants for transaction type names - demeter law = never speaks with strangers
This commit is contained in:
@@ -327,15 +327,15 @@ class JournalRepository implements JournalRepositoryInterface
|
||||
$fromAccount = null;
|
||||
$toAccount = null;
|
||||
switch ($type->type) {
|
||||
case 'Withdrawal':
|
||||
case TransactionType::WITHDRAWAL:
|
||||
list($fromAccount, $toAccount) = $this->storeWithdrawalAccounts($data);
|
||||
break;
|
||||
|
||||
case 'Deposit':
|
||||
case TransactionType::DEPOSIT:
|
||||
list($fromAccount, $toAccount) = $this->storeDepositAccounts($data);
|
||||
|
||||
break;
|
||||
case 'Transfer':
|
||||
case TransactionType::TRANSFER:
|
||||
$fromAccount = Account::find($data['account_from_id']);
|
||||
$toAccount = Account::find($data['account_to_id']);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user