Refactor old methods.

This commit is contained in:
James Cole
2021-04-06 13:30:09 +02:00
parent 5ceef2e9c3
commit 69b1769f22
54 changed files with 191 additions and 478 deletions

View File

@@ -70,14 +70,14 @@ class OperatorQuerySearch implements SearchInterface
private CurrencyRepositoryInterface $currencyRepository;
private Carbon $date;
private int $limit;
private Collection $modifiers;
private Collection $modifiers;
private Collection $operators;
private string $originalQuery;
private int $page;
private ParsedQuery $query;
private float $startTime;
private TagRepositoryInterface $tagRepository;
private TransactionTypeRepositoryInterface $typeRepository; // obsolete
private TransactionTypeRepositoryInterface $typeRepository; // obsolete
private User $user;
private array $validOperators;
private array $words;
@@ -179,7 +179,7 @@ private Collection $modifiers;
public function searchTransactions(): LengthAwarePaginator
{
if (0 === count($this->getWords()) && 0 === count($this->getOperators())) {
return new LengthAwarePaginator;
return new LengthAwarePaginator([],0,5,1);
}
return $this->collector->getPaginatedGroups();
@@ -245,7 +245,9 @@ private Collection $modifiers;
Log::error(sprintf('Cannot handle node %s', $class));
throw new FireflyException(sprintf('Firefly III search cant handle "%s"-nodes', $class));
case Subquery::class:
/** @var Subquery $searchNode */
// loop all notes in subquery:
/** @var Node $subNode */
foreach ($searchNode->getNodes() as $subNode) {
$this->handleSearchNode($subNode); // lets hope its not too recursive!
}