mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-17 09:51:40 +00:00
chore: fix various qodana issues
This commit is contained in:
@@ -254,37 +254,6 @@ class AccountUpdateService
|
||||
return $account;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param array $data
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @deprecated In Firefly III v5.8.0 and onwards, credit transactions for liabilities are no longer created.
|
||||
*/
|
||||
private function updateCreditLiability(Account $account, array $data): void
|
||||
{
|
||||
$type = $account->accountType;
|
||||
$valid = config('firefly.valid_liabilities');
|
||||
if (in_array($type->type, $valid, true)) {
|
||||
$direction = array_key_exists('liability_direction', $data) ? $data['liability_direction'] : 'empty';
|
||||
// check if is submitted as empty, that makes it valid:
|
||||
if ($this->validOBData($data) && !$this->isEmptyOBData($data)) {
|
||||
$openingBalance = $data['opening_balance'];
|
||||
$openingBalanceDate = $data['opening_balance_date'];
|
||||
if ('credit' === $direction) {
|
||||
$this->updateCreditTransaction($account, $direction, $openingBalance, $openingBalanceDate);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$this->validOBData($data) && $this->isEmptyOBData($data)) {
|
||||
$this->deleteCreditTransaction($account);
|
||||
}
|
||||
if ($this->validOBData($data) && !$this->isEmptyOBData($data) && 'credit' !== $direction) {
|
||||
$this->deleteCreditTransaction($account);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param array $data
|
||||
|
Reference in New Issue
Block a user