Various code quality improvements.

This commit is contained in:
James Cole
2020-08-01 17:51:52 +02:00
parent ae7cd76d87
commit 1169c5c5e2
7 changed files with 30 additions and 28 deletions

View File

@@ -101,7 +101,7 @@ class OtherCurrenciesCorrections extends Command
if (array_key_exists($accountId, $this->accountCurrencies) && 0 === $this->accountCurrencies[$accountId]) {
return null; // @codeCoverageIgnore
}
if (isset($this->accountCurrencies[$accountId]) && $this->accountCurrencies[$accountId] instanceof TransactionCurrency) {
if (array_key_exists($accountId, $this->accountCurrencies) && $this->accountCurrencies[$accountId] instanceof TransactionCurrency) {
return $this->accountCurrencies[$accountId]; // @codeCoverageIgnore
}
$currency = $this->accountRepos->getAccountCurrency($account);

View File

@@ -335,10 +335,10 @@ class TransferCurrenciesCorrections extends Command
private function getCurrency(Account $account): ?TransactionCurrency
{
$accountId = $account->id;
if (isset($this->accountCurrencies[$accountId]) && 0 === $this->accountCurrencies[$accountId]) {
if (array_key_exists($accountId, $this->accountCurrencies) && 0 === $this->accountCurrencies[$accountId]) {
return null; // @codeCoverageIgnore
}
if (isset($this->accountCurrencies[$accountId]) && $this->accountCurrencies[$accountId] instanceof TransactionCurrency) {
if (array_key_exists($accountId, $this->accountCurrencies) && $this->accountCurrencies[$accountId] instanceof TransactionCurrency) {
return $this->accountCurrencies[$accountId]; // @codeCoverageIgnore
}
$currency = $this->accountRepos->getAccountCurrency($account);