mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-21 21:20:04 +00:00
Clean up code.
This commit is contained in:
@@ -37,14 +37,14 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
||||
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Support\Search\QueryParser\QueryParserInterface;
|
||||
use FireflyIII\Support\Search\QueryParser\Node;
|
||||
use FireflyIII\Support\Search\QueryParser\FieldNode;
|
||||
use FireflyIII\Support\Search\QueryParser\StringNode;
|
||||
use FireflyIII\Support\Search\QueryParser\NodeGroup;
|
||||
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||
use FireflyIII\Support\ParseDateString;
|
||||
use FireflyIII\Support\Search\QueryParser\FieldNode;
|
||||
use FireflyIII\Support\Search\QueryParser\Node;
|
||||
use FireflyIII\Support\Search\QueryParser\NodeGroup;
|
||||
use FireflyIII\Support\Search\QueryParser\QueryParserInterface;
|
||||
use FireflyIII\Support\Search\QueryParser\StringNode;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Collection;
|
||||
@@ -56,26 +56,26 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
class OperatorQuerySearch implements SearchInterface
|
||||
{
|
||||
protected Carbon $date;
|
||||
protected Carbon $date;
|
||||
private readonly AccountRepositoryInterface $accountRepository;
|
||||
private readonly BillRepositoryInterface $billRepository;
|
||||
private readonly BudgetRepositoryInterface $budgetRepository;
|
||||
private readonly CategoryRepositoryInterface $categoryRepository;
|
||||
private GroupCollectorInterface $collector;
|
||||
private GroupCollectorInterface $collector;
|
||||
private readonly CurrencyRepositoryInterface $currencyRepository;
|
||||
private array $excludeTags;
|
||||
private array $includeAnyTags;
|
||||
private array $excludeTags;
|
||||
private array $includeAnyTags;
|
||||
// added to fix #8632
|
||||
private array $includeTags;
|
||||
private array $invalidOperators;
|
||||
private int $limit;
|
||||
private array $includeTags;
|
||||
private array $invalidOperators;
|
||||
private int $limit;
|
||||
private readonly Collection $operators;
|
||||
private int $page;
|
||||
private array $prohibitedWords;
|
||||
private int $page;
|
||||
private array $prohibitedWords;
|
||||
private readonly float $startTime;
|
||||
private readonly TagRepositoryInterface $tagRepository;
|
||||
private readonly array $validOperators;
|
||||
private array $words;
|
||||
private array $words;
|
||||
|
||||
/**
|
||||
* OperatorQuerySearch constructor.
|
||||
@@ -122,16 +122,6 @@ class OperatorQuerySearch implements SearchInterface
|
||||
return implode(' ', $this->words);
|
||||
}
|
||||
|
||||
public function getWords(): array
|
||||
{
|
||||
return $this->words;
|
||||
}
|
||||
|
||||
public function getExcludedWords(): array
|
||||
{
|
||||
return $this->prohibitedWords;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
@@ -202,15 +192,6 @@ class OperatorQuerySearch implements SearchInterface
|
||||
}
|
||||
}
|
||||
|
||||
private function handleNodeGroup(NodeGroup $node, bool $flipProhibitedFlag): void
|
||||
{
|
||||
$prohibited = $node->isProhibited($flipProhibitedFlag);
|
||||
|
||||
foreach ($node->getNodes() as $subNode) {
|
||||
$this->handleSearchNode($subNode, $prohibited);
|
||||
}
|
||||
}
|
||||
|
||||
private function handleStringNode(StringNode $node, bool $flipProhibitedFlag): void
|
||||
{
|
||||
$string = $node->getValue();
|
||||
@@ -2775,6 +2756,15 @@ class OperatorQuerySearch implements SearchInterface
|
||||
}
|
||||
}
|
||||
|
||||
private function handleNodeGroup(NodeGroup $node, bool $flipProhibitedFlag): void
|
||||
{
|
||||
$prohibited = $node->isProhibited($flipProhibitedFlag);
|
||||
|
||||
foreach ($node->getNodes() as $subNode) {
|
||||
$this->handleSearchNode($subNode, $prohibited);
|
||||
}
|
||||
}
|
||||
|
||||
public function searchTime(): float
|
||||
{
|
||||
return microtime(true) - $this->startTime;
|
||||
@@ -2835,6 +2825,16 @@ class OperatorQuerySearch implements SearchInterface
|
||||
}
|
||||
}
|
||||
|
||||
public function getWords(): array
|
||||
{
|
||||
return $this->words;
|
||||
}
|
||||
|
||||
public function getExcludedWords(): array
|
||||
{
|
||||
return $this->prohibitedWords;
|
||||
}
|
||||
|
||||
public function setDate(Carbon $date): void
|
||||
{
|
||||
$this->date = $date;
|
||||
|
||||
Reference in New Issue
Block a user