Fix various code.

This commit is contained in:
James Cole
2025-05-27 17:06:15 +02:00
parent d8f512ca3a
commit 2cb14f6b72
123 changed files with 581 additions and 500 deletions

View File

@@ -719,10 +719,10 @@ class OperatorQuerySearch implements SearchInterface
//
case 'currency_is':
$currency = $this->findCurrency($value);
if (null !== $currency) {
if ($currency instanceof TransactionCurrency) {
$this->collector->setCurrency($currency);
}
if (null === $currency) {
if (!$currency instanceof TransactionCurrency) {
$this->collector->findNothing();
}
@@ -730,10 +730,10 @@ class OperatorQuerySearch implements SearchInterface
case '-currency_is':
$currency = $this->findCurrency($value);
if (null !== $currency) {
if ($currency instanceof TransactionCurrency) {
$this->collector->excludeCurrency($currency);
}
if (null === $currency) {
if (!$currency instanceof TransactionCurrency) {
$this->collector->findNothing();
}
@@ -741,10 +741,10 @@ class OperatorQuerySearch implements SearchInterface
case 'foreign_currency_is':
$currency = $this->findCurrency($value);
if (null !== $currency) {
if ($currency instanceof TransactionCurrency) {
$this->collector->setForeignCurrency($currency);
}
if (null === $currency) {
if (!$currency instanceof TransactionCurrency) {
$this->collector->findNothing();
}
@@ -752,10 +752,10 @@ class OperatorQuerySearch implements SearchInterface
case '-foreign_currency_is':
$currency = $this->findCurrency($value);
if (null !== $currency) {
if ($currency instanceof TransactionCurrency) {
$this->collector->excludeForeignCurrency($currency);
}
if (null === $currency) {
if (!$currency instanceof TransactionCurrency) {
$this->collector->findNothing();
}
@@ -2109,7 +2109,7 @@ class OperatorQuerySearch implements SearchInterface
}
$result = $this->currencyRepository->findByCode($value);
if (null === $result) {
$result = $this->currencyRepository->findByName($value);
return $this->currencyRepository->findByName($value);
}
return $result;