Various code cleanup and fixed alignments.

This commit is contained in:
James Cole
2024-01-01 14:43:56 +01:00
parent 1368aafe5f
commit f963ac63f1
443 changed files with 3668 additions and 3672 deletions

View File

@@ -172,7 +172,7 @@ class OperatorQuerySearch implements SearchInterface
$operator = substr($operator, 1);
}
$config = config(sprintf('search.operators.%s', $operator));
$config = config(sprintf('search.operators.%s', $operator));
if (null === $config) {
throw new FireflyException(sprintf('No configuration for search operator "%s"', $operator));
}
@@ -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;
@@ -285,10 +285,10 @@ class OperatorQuerySearch implements SearchInterface
/** @var Field $searchNode */
// used to search for x:y
$operator = strtolower($searchNode->getValue());
$value = $searchNode->getNode()->getValue();
$prohibited = BoolOperator::PROHIBITED === $searchNode->getBoolOperator();
$context = config(sprintf('search.operators.%s.needs_context', $operator));
$operator = strtolower($searchNode->getValue());
$value = $searchNode->getNode()->getValue();
$prohibited = BoolOperator::PROHIBITED === $searchNode->getBoolOperator();
$context = config(sprintf('search.operators.%s.needs_context', $operator));
// is an operator that needs no context, and value is false, then prohibited = true.
if ('false' === $value && in_array($operator, $this->validOperators, true) && false === $context && !$prohibited) {
@@ -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]));
}
@@ -542,25 +542,25 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'journal_id':
$parts = explode(',', $value);
$parts = explode(',', $value);
$this->collector->setJournalIds($parts);
break;
case '-journal_id':
$parts = explode(',', $value);
$parts = explode(',', $value);
$this->collector->excludeJournalIds($parts);
break;
case 'id':
$parts = explode(',', $value);
$parts = explode(',', $value);
$this->collector->setIds($parts);
break;
case '-id':
$parts = explode(',', $value);
$parts = explode(',', $value);
$this->collector->excludeIds($parts);
break;
@@ -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]));
}
@@ -668,8 +668,8 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'account_id':
$parts = explode(',', $value);
$collection = new Collection();
$parts = explode(',', $value);
$collection = new Collection();
foreach ($parts as $accountId) {
$account = $this->accountRepository->find((int) $accountId);
if (null !== $account) {
@@ -686,8 +686,8 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-account_id':
$parts = explode(',', $value);
$collection = new Collection();
$parts = explode(',', $value);
$collection = new Collection();
foreach ($parts as $accountId) {
$account = $this->accountRepository->find((int) $accountId);
if (null !== $account) {
@@ -707,37 +707,37 @@ class OperatorQuerySearch implements SearchInterface
// cash account
//
case 'source_is_cash':
$account = $this->getCashAccount();
$account = $this->getCashAccount();
$this->collector->setSourceAccounts(new Collection([$account]));
break;
case '-source_is_cash':
$account = $this->getCashAccount();
$account = $this->getCashAccount();
$this->collector->excludeSourceAccounts(new Collection([$account]));
break;
case 'destination_is_cash':
$account = $this->getCashAccount();
$account = $this->getCashAccount();
$this->collector->setDestinationAccounts(new Collection([$account]));
break;
case '-destination_is_cash':
$account = $this->getCashAccount();
$account = $this->getCashAccount();
$this->collector->excludeDestinationAccounts(new Collection([$account]));
break;
case 'account_is_cash':
$account = $this->getCashAccount();
$account = $this->getCashAccount();
$this->collector->setAccounts(new Collection([$account]));
break;
case '-account_is_cash':
$account = $this->getCashAccount();
$account = $this->getCashAccount();
$this->collector->excludeAccounts(new Collection([$account]));
break;
@@ -766,7 +766,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'description_contains':
$this->words[] = $value;
$this->words[] = $value;
return false;
@@ -789,7 +789,7 @@ class OperatorQuerySearch implements SearchInterface
// currency
//
case 'currency_is':
$currency = $this->findCurrency($value);
$currency = $this->findCurrency($value);
if (null !== $currency) {
$this->collector->setCurrency($currency);
}
@@ -800,7 +800,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-currency_is':
$currency = $this->findCurrency($value);
$currency = $this->findCurrency($value);
if (null !== $currency) {
$this->collector->excludeCurrency($currency);
}
@@ -811,7 +811,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'foreign_currency_is':
$currency = $this->findCurrency($value);
$currency = $this->findCurrency($value);
if (null !== $currency) {
$this->collector->setForeignCurrency($currency);
}
@@ -822,7 +822,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-foreign_currency_is':
$currency = $this->findCurrency($value);
$currency = $this->findCurrency($value);
if (null !== $currency) {
$this->collector->excludeForeignCurrency($currency);
}
@@ -864,7 +864,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'category_is':
$category = $this->categoryRepository->findByName($value);
$category = $this->categoryRepository->findByName($value);
if (null !== $category) {
$this->collector->setCategory($category);
@@ -875,7 +875,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-category_is':
$category = $this->categoryRepository->findByName($value);
$category = $this->categoryRepository->findByName($value);
if (null !== $category) {
$this->collector->excludeCategory($category);
@@ -885,7 +885,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'category_ends':
$result = $this->categoryRepository->categoryEndsWith($value, 1337);
$result = $this->categoryRepository->categoryEndsWith($value, 1337);
if ($result->count() > 0) {
$this->collector->setCategories($result);
}
@@ -896,7 +896,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-category_ends':
$result = $this->categoryRepository->categoryEndsWith($value, 1337);
$result = $this->categoryRepository->categoryEndsWith($value, 1337);
if ($result->count() > 0) {
$this->collector->excludeCategories($result);
}
@@ -907,7 +907,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'category_starts':
$result = $this->categoryRepository->categoryStartsWith($value, 1337);
$result = $this->categoryRepository->categoryStartsWith($value, 1337);
if ($result->count() > 0) {
$this->collector->setCategories($result);
}
@@ -918,7 +918,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-category_starts':
$result = $this->categoryRepository->categoryStartsWith($value, 1337);
$result = $this->categoryRepository->categoryStartsWith($value, 1337);
if ($result->count() > 0) {
$this->collector->excludeCategories($result);
}
@@ -929,7 +929,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'category_contains':
$result = $this->categoryRepository->searchCategory($value, 1337);
$result = $this->categoryRepository->searchCategory($value, 1337);
if ($result->count() > 0) {
$this->collector->setCategories($result);
}
@@ -940,7 +940,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-category_contains':
$result = $this->categoryRepository->searchCategory($value, 1337);
$result = $this->categoryRepository->searchCategory($value, 1337);
if ($result->count() > 0) {
$this->collector->excludeCategories($result);
}
@@ -966,7 +966,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'budget_contains':
$result = $this->budgetRepository->searchBudget($value, 1337);
$result = $this->budgetRepository->searchBudget($value, 1337);
if ($result->count() > 0) {
$this->collector->setBudgets($result);
}
@@ -977,7 +977,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-budget_contains':
$result = $this->budgetRepository->searchBudget($value, 1337);
$result = $this->budgetRepository->searchBudget($value, 1337);
if ($result->count() > 0) {
$this->collector->excludeBudgets($result);
}
@@ -988,7 +988,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'budget_is':
$budget = $this->budgetRepository->findByName($value);
$budget = $this->budgetRepository->findByName($value);
if (null !== $budget) {
$this->collector->setBudget($budget);
@@ -999,7 +999,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-budget_is':
$budget = $this->budgetRepository->findByName($value);
$budget = $this->budgetRepository->findByName($value);
if (null !== $budget) {
$this->collector->excludeBudget($budget);
@@ -1010,7 +1010,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'budget_ends':
$result = $this->budgetRepository->budgetEndsWith($value, 1337);
$result = $this->budgetRepository->budgetEndsWith($value, 1337);
if ($result->count() > 0) {
$this->collector->setBudgets($result);
}
@@ -1021,7 +1021,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-budget_ends':
$result = $this->budgetRepository->budgetEndsWith($value, 1337);
$result = $this->budgetRepository->budgetEndsWith($value, 1337);
if ($result->count() > 0) {
$this->collector->excludeBudgets($result);
}
@@ -1032,7 +1032,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'budget_starts':
$result = $this->budgetRepository->budgetStartsWith($value, 1337);
$result = $this->budgetRepository->budgetStartsWith($value, 1337);
if ($result->count() > 0) {
$this->collector->setBudgets($result);
}
@@ -1043,7 +1043,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-budget_starts':
$result = $this->budgetRepository->budgetStartsWith($value, 1337);
$result = $this->budgetRepository->budgetStartsWith($value, 1337);
if ($result->count() > 0) {
$this->collector->excludeBudgets($result);
}
@@ -1069,7 +1069,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'bill_contains':
$result = $this->billRepository->searchBill($value, 1337);
$result = $this->billRepository->searchBill($value, 1337);
if ($result->count() > 0) {
$this->collector->setBills($result);
@@ -1080,7 +1080,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-bill_contains':
$result = $this->billRepository->searchBill($value, 1337);
$result = $this->billRepository->searchBill($value, 1337);
if ($result->count() > 0) {
$this->collector->excludeBills($result);
@@ -1091,7 +1091,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'bill_is':
$bill = $this->billRepository->findByName($value);
$bill = $this->billRepository->findByName($value);
if (null !== $bill) {
$this->collector->setBill($bill);
@@ -1102,7 +1102,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-bill_is':
$bill = $this->billRepository->findByName($value);
$bill = $this->billRepository->findByName($value);
if (null !== $bill) {
$this->collector->excludeBills(new Collection([$bill]));
@@ -1113,7 +1113,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'bill_ends':
$result = $this->billRepository->billEndsWith($value, 1337);
$result = $this->billRepository->billEndsWith($value, 1337);
if ($result->count() > 0) {
$this->collector->setBills($result);
}
@@ -1124,7 +1124,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-bill_ends':
$result = $this->billRepository->billEndsWith($value, 1337);
$result = $this->billRepository->billEndsWith($value, 1337);
if ($result->count() > 0) {
$this->collector->excludeBills($result);
}
@@ -1135,7 +1135,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'bill_starts':
$result = $this->billRepository->billStartsWith($value, 1337);
$result = $this->billRepository->billStartsWith($value, 1337);
if ($result->count() > 0) {
$this->collector->setBills($result);
}
@@ -1146,7 +1146,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-bill_starts':
$result = $this->billRepository->billStartsWith($value, 1337);
$result = $this->billRepository->billStartsWith($value, 1337);
if ($result->count() > 0) {
$this->collector->excludeBills($result);
}
@@ -1173,7 +1173,7 @@ class OperatorQuerySearch implements SearchInterface
case '-tag_is_not':
case 'tag_is':
$result = $this->tagRepository->findByTag($value);
$result = $this->tagRepository->findByTag($value);
if (null !== $result) {
$this->includeTags[] = $result->id;
$this->includeTags = array_unique($this->includeTags);
@@ -1187,7 +1187,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'tag_contains':
$tags = $this->tagRepository->searchTag($value);
$tags = $this->tagRepository->searchTag($value);
if (0 === $tags->count()) {
app('log')->info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator));
$this->collector->findNothing();
@@ -1200,7 +1200,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'tag_starts':
$tags = $this->tagRepository->tagStartsWith($value);
$tags = $this->tagRepository->tagStartsWith($value);
if (0 === $tags->count()) {
app('log')->info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator));
$this->collector->findNothing();
@@ -1213,7 +1213,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-tag_starts':
$tags = $this->tagRepository->tagStartsWith($value);
$tags = $this->tagRepository->tagStartsWith($value);
if (0 === $tags->count()) {
app('log')->info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator));
$this->collector->findNothing();
@@ -1226,7 +1226,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case 'tag_ends':
$tags = $this->tagRepository->tagEndsWith($value);
$tags = $this->tagRepository->tagEndsWith($value);
if (0 === $tags->count()) {
app('log')->info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator));
$this->collector->findNothing();
@@ -1239,7 +1239,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-tag_ends':
$tags = $this->tagRepository->tagEndsWith($value);
$tags = $this->tagRepository->tagEndsWith($value);
if (0 === $tags->count()) {
app('log')->info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator));
$this->collector->findNothing();
@@ -1252,7 +1252,7 @@ class OperatorQuerySearch implements SearchInterface
break;
case '-tag_contains':
$tags = $this->tagRepository->searchTag($value)->keyBy('id');
$tags = $this->tagRepository->searchTag($value)->keyBy('id');
if (0 === $tags->count()) {
app('log')->info(sprintf('No valid tags in "%s"-operator, so search will not return ANY results.', $operator));
@@ -1267,7 +1267,7 @@ class OperatorQuerySearch implements SearchInterface
case '-tag_is':
case 'tag_is_not':
$result = $this->tagRepository->findByTag($value);
$result = $this->tagRepository->findByTag($value);
if (null !== $result) {
$this->excludeTags[] = $result->id;
$this->excludeTags = array_unique($this->excludeTags);
@@ -1346,8 +1346,8 @@ class OperatorQuerySearch implements SearchInterface
case 'amount_is':
// strip comma's, make dots.
app('log')->debug(sprintf('Original value "%s"', $value));
$value = str_replace(',', '.', $value);
$amount = app('steam')->positive($value);
$value = str_replace(',', '.', $value);
$amount = app('steam')->positive($value);
app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
$this->collector->amountIs($amount);
@@ -1356,8 +1356,8 @@ class OperatorQuerySearch implements SearchInterface
case '-amount_is':
// strip comma's, make dots.
app('log')->debug(sprintf('Original value "%s"', $value));
$value = str_replace(',', '.', $value);
$amount = app('steam')->positive($value);
$value = str_replace(',', '.', $value);
$amount = app('steam')->positive($value);
app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
$this->collector->amountIsNot($amount);
@@ -1365,9 +1365,9 @@ class OperatorQuerySearch implements SearchInterface
case 'foreign_amount_is':
// strip comma's, make dots.
$value = str_replace(',', '.', $value);
$value = str_replace(',', '.', $value);
$amount = app('steam')->positive($value);
$amount = app('steam')->positive($value);
app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
$this->collector->foreignAmountIs($amount);
@@ -1375,9 +1375,9 @@ class OperatorQuerySearch implements SearchInterface
case '-foreign_amount_is':
// strip comma's, make dots.
$value = str_replace(',', '.', $value);
$value = str_replace(',', '.', $value);
$amount = app('steam')->positive($value);
$amount = app('steam')->positive($value);
app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
$this->collector->foreignAmountIsNot($amount);
@@ -1386,9 +1386,9 @@ class OperatorQuerySearch implements SearchInterface
case '-amount_more':
case 'amount_less':
// strip comma's, make dots.
$value = str_replace(',', '.', $value);
$value = str_replace(',', '.', $value);
$amount = app('steam')->positive($value);
$amount = app('steam')->positive($value);
app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
$this->collector->amountLess($amount);
@@ -1397,9 +1397,9 @@ class OperatorQuerySearch implements SearchInterface
case '-foreign_amount_more':
case 'foreign_amount_less':
// strip comma's, make dots.
$value = str_replace(',', '.', $value);
$value = str_replace(',', '.', $value);
$amount = app('steam')->positive($value);
$amount = app('steam')->positive($value);
app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
$this->collector->foreignAmountLess($amount);
@@ -1409,8 +1409,8 @@ class OperatorQuerySearch implements SearchInterface
case 'amount_more':
app('log')->debug(sprintf('Now handling operator "%s"', $operator));
// strip comma's, make dots.
$value = str_replace(',', '.', $value);
$amount = app('steam')->positive($value);
$value = str_replace(',', '.', $value);
$amount = app('steam')->positive($value);
app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
$this->collector->amountMore($amount);
@@ -1420,8 +1420,8 @@ class OperatorQuerySearch implements SearchInterface
case 'foreign_amount_more':
app('log')->debug(sprintf('Now handling operator "%s"', $operator));
// strip comma's, make dots.
$value = str_replace(',', '.', $value);
$amount = app('steam')->positive($value);
$value = str_replace(',', '.', $value);
$amount = app('steam')->positive($value);
app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
$this->collector->foreignAmountMore($amount);
@@ -1447,147 +1447,147 @@ class OperatorQuerySearch implements SearchInterface
//
case '-date_on':
case 'date_on':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setExactDateParams($range, $prohibited);
return false;
case 'date_before':
case '-date_after':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setDateBeforeParams($range);
return false;
case 'date_after':
case '-date_before':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setDateAfterParams($range);
return false;
case 'interest_date_on':
case '-interest_date_on':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setExactMetaDateParams('interest_date', $range, $prohibited);
return false;
case 'interest_date_before':
case '-interest_date_after':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setMetaDateBeforeParams('interest_date', $range);
return false;
case 'interest_date_after':
case '-interest_date_before':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setMetaDateAfterParams('interest_date', $range);
return false;
case 'book_date_on':
case '-book_date_on':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setExactMetaDateParams('book_date', $range, $prohibited);
return false;
case 'book_date_before':
case '-book_date_after':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setMetaDateBeforeParams('book_date', $range);
return false;
case 'book_date_after':
case '-book_date_before':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setMetaDateAfterParams('book_date', $range);
return false;
case 'process_date_on':
case '-process_date_on':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setExactMetaDateParams('process_date', $range, $prohibited);
return false;
case 'process_date_before':
case '-process_date_after':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setMetaDateBeforeParams('process_date', $range);
return false;
case 'process_date_after':
case '-process_date_before':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setMetaDateAfterParams('process_date', $range);
return false;
case 'due_date_on':
case '-due_date_on':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setExactMetaDateParams('due_date', $range, $prohibited);
return false;
case 'due_date_before':
case '-due_date_after':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setMetaDateBeforeParams('due_date', $range);
return false;
case 'due_date_after':
case '-due_date_before':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setMetaDateAfterParams('due_date', $range);
return false;
case 'payment_date_on':
case '-payment_date_on':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setExactMetaDateParams('payment_date', $range, $prohibited);
return false;
case 'payment_date_before':
case '-payment_date_after':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setMetaDateBeforeParams('payment_date', $range);
return false;
case 'payment_date_after':
case '-payment_date_before':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setMetaDateAfterParams('payment_date', $range);
return false;
case 'invoice_date_on':
case '-invoice_date_on':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setExactMetaDateParams('invoice_date', $range, $prohibited);
return false;
case 'invoice_date_before':
case '-invoice_date_after':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setMetaDateBeforeParams('invoice_date', $range);
return false;
case 'invoice_date_after':
case '-invoice_date_before':
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setMetaDateAfterParams('invoice_date', $range);
return false;
@@ -1595,7 +1595,7 @@ class OperatorQuerySearch implements SearchInterface
case 'created_at_on':
case '-created_at_on':
app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value));
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setExactObjectDateParams('created_at', $range, $prohibited);
return false;
@@ -1603,7 +1603,7 @@ class OperatorQuerySearch implements SearchInterface
case 'created_at_before':
case '-created_at_after':
app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value));
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setObjectDateBeforeParams('created_at', $range);
return false;
@@ -1611,7 +1611,7 @@ class OperatorQuerySearch implements SearchInterface
case 'created_at_after':
case '-created_at_before':
app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value));
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setObjectDateAfterParams('created_at', $range);
return false;
@@ -1619,7 +1619,7 @@ class OperatorQuerySearch implements SearchInterface
case 'updated_at_on':
case '-updated_at_on':
app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value));
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setExactObjectDateParams('updated_at', $range, $prohibited);
return false;
@@ -1627,7 +1627,7 @@ class OperatorQuerySearch implements SearchInterface
case 'updated_at_before':
case '-updated_at_after':
app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value));
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setObjectDateBeforeParams('updated_at', $range);
return false;
@@ -1635,7 +1635,7 @@ class OperatorQuerySearch implements SearchInterface
case 'updated_at_after':
case '-updated_at_before':
app('log')->debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value));
$range = $this->parseDateRange($operator, $value);
$range = $this->parseDateRange($operator, $value);
$this->setObjectDateAfterParams('updated_at', $range);
return false;
@@ -1934,7 +1934,7 @@ class OperatorQuerySearch implements SearchInterface
}
}
// string position (default): starts with:
$stringMethod = 'str_starts_with';
$stringMethod = 'str_starts_with';
// string position: ends with:
if (StringPosition::ENDS === $stringPosition) {
@@ -1948,7 +1948,7 @@ class OperatorQuerySearch implements SearchInterface
}
// get accounts:
$accounts = $this->accountRepository->searchAccount($value, $searchTypes, 1337);
$accounts = $this->accountRepository->searchAccount($value, $searchTypes, 1337);
if (0 === $accounts->count()) {
app('log')->debug('Found zero accounts, search for non existing account, NO results will be returned.');
$this->collector->findNothing();
@@ -1956,7 +1956,7 @@ class OperatorQuerySearch implements SearchInterface
return;
}
app('log')->debug(sprintf('Found %d accounts, will filter.', $accounts->count()));
$filtered = $accounts->filter(
$filtered = $accounts->filter(
static function (Account $account) use ($value, $stringMethod) {
return $stringMethod(strtolower($account->name), strtolower($value));
}
@@ -2011,7 +2011,7 @@ class OperatorQuerySearch implements SearchInterface
}
// string position (default): starts with:
$stringMethod = 'str_starts_with';
$stringMethod = 'str_starts_with';
// string position: ends with:
if (StringPosition::ENDS === $stringPosition) {
@@ -2025,7 +2025,7 @@ class OperatorQuerySearch implements SearchInterface
}
// search for accounts:
$accounts = $this->accountRepository->searchAccountNr($value, $searchTypes, 1337);
$accounts = $this->accountRepository->searchAccountNr($value, $searchTypes, 1337);
if (0 === $accounts->count()) {
app('log')->debug('Found zero accounts, search for invalid account.');
$this->collector->findNothing();
@@ -2035,7 +2035,7 @@ class OperatorQuerySearch implements SearchInterface
// if found, do filter
app('log')->debug(sprintf('Found %d accounts, will filter.', $accounts->count()));
$filtered = $accounts->filter(
$filtered = $accounts->filter(
static function (Account $account) use ($value, $stringMethod) {
// either IBAN or account number
$ibanMatch = $stringMethod(strtolower((string) $account->iban), strtolower($value));