mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Fix #8425
This commit is contained in:
@@ -232,7 +232,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
$this->collector->setUser($user);
|
||||
$this->collector->withAccountInformation()->withCategoryInformation()->withBudgetInformation();
|
||||
|
||||
$this->setLimit((int) app('preferences')->getForUser($user, 'listPageSize', 50)->data);
|
||||
$this->setLimit((int)app('preferences')->getForUser($user, 'listPageSize', 50)->data);
|
||||
}
|
||||
|
||||
public function setLimit(int $limit): void
|
||||
@@ -274,7 +274,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
case Emoticon::class:
|
||||
case Emoji::class:
|
||||
case Mention::class:
|
||||
$allWords = (string) $searchNode->getValue();
|
||||
$allWords = (string)$searchNode->getValue();
|
||||
app('log')->debug(sprintf('Add words "%s" to search string, because Node class is "%s"', $allWords, $class));
|
||||
$this->words[] = $allWords;
|
||||
|
||||
@@ -304,11 +304,11 @@ class OperatorQuerySearch implements SearchInterface
|
||||
// must be valid operator:
|
||||
if (
|
||||
in_array($operator, $this->validOperators, true)
|
||||
&& $this->updateCollector($operator, (string) $value, $prohibited)) {
|
||||
&& $this->updateCollector($operator, (string)$value, $prohibited)) {
|
||||
$this->operators->push(
|
||||
[
|
||||
'type' => self::getRootOperator($operator),
|
||||
'value' => (string) $value,
|
||||
'value' => (string)$value,
|
||||
'prohibited' => $prohibited,
|
||||
]
|
||||
);
|
||||
@@ -318,7 +318,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
app('log')->debug(sprintf('Added INVALID operator type "%s"', $operator));
|
||||
$this->invalidOperators[] = [
|
||||
'type' => $operator,
|
||||
'value' => (string) $value,
|
||||
'value' => (string)$value,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -518,7 +518,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
break;
|
||||
|
||||
case 'source_account_id':
|
||||
$account = $this->accountRepository->find((int) $value);
|
||||
$account = $this->accountRepository->find((int)$value);
|
||||
if (null !== $account) {
|
||||
$this->collector->setSourceAccounts(new Collection([$account]));
|
||||
}
|
||||
@@ -530,7 +530,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
break;
|
||||
|
||||
case '-source_account_id':
|
||||
$account = $this->accountRepository->find((int) $value);
|
||||
$account = $this->accountRepository->find((int)$value);
|
||||
if (null !== $account) {
|
||||
$this->collector->excludeSourceAccounts(new Collection([$account]));
|
||||
}
|
||||
@@ -646,7 +646,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
break;
|
||||
|
||||
case 'destination_account_id':
|
||||
$account = $this->accountRepository->find((int) $value);
|
||||
$account = $this->accountRepository->find((int)$value);
|
||||
if (null !== $account) {
|
||||
$this->collector->setDestinationAccounts(new Collection([$account]));
|
||||
}
|
||||
@@ -657,7 +657,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
break;
|
||||
|
||||
case '-destination_account_id':
|
||||
$account = $this->accountRepository->find((int) $value);
|
||||
$account = $this->accountRepository->find((int)$value);
|
||||
if (null !== $account) {
|
||||
$this->collector->excludeDestinationAccounts(new Collection([$account]));
|
||||
}
|
||||
@@ -671,7 +671,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
$parts = explode(',', $value);
|
||||
$collection = new Collection();
|
||||
foreach ($parts as $accountId) {
|
||||
$account = $this->accountRepository->find((int) $accountId);
|
||||
$account = $this->accountRepository->find((int)$accountId);
|
||||
if (null !== $account) {
|
||||
$collection->push($account);
|
||||
}
|
||||
@@ -689,7 +689,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
$parts = explode(',', $value);
|
||||
$collection = new Collection();
|
||||
foreach ($parts as $accountId) {
|
||||
$account = $this->accountRepository->find((int) $accountId);
|
||||
$account = $this->accountRepository->find((int)$accountId);
|
||||
if (null !== $account) {
|
||||
$collection->push($account);
|
||||
}
|
||||
@@ -1904,6 +1904,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
* stringPosition: 1 = start (default), 2 = end, 3 = contains, 4 = is
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
|
||||
* @SuppressWarnings(PHPMD.NPathComplexity)
|
||||
*/
|
||||
private function searchAccount(string $value, SearchDirection $searchDirection, StringPosition $stringPosition, bool $prohibited = false): void
|
||||
{
|
||||
@@ -2043,7 +2044,7 @@ class OperatorQuerySearch implements SearchInterface
|
||||
$filtered = $accounts->filter(
|
||||
static function (Account $account) use ($value, $stringMethod) {
|
||||
// either IBAN or account number
|
||||
$ibanMatch = $stringMethod(strtolower((string) $account->iban), strtolower($value));
|
||||
$ibanMatch = $stringMethod(strtolower((string)$account->iban), strtolower($value));
|
||||
$accountNrMatch = false;
|
||||
|
||||
/** @var AccountMeta $meta */
|
||||
|
Reference in New Issue
Block a user