From 50e07d422f5dcce76c93c412b0e92d995bc2948d Mon Sep 17 00:00:00 2001 From: Sobuno Date: Wed, 1 Jan 2025 05:13:12 +0100 Subject: [PATCH] Small QoL additions --- app/Support/Search/QueryParser.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Support/Search/QueryParser.php b/app/Support/Search/QueryParser.php index 9005671c71..19a1c678ca 100644 --- a/app/Support/Search/QueryParser.php +++ b/app/Support/Search/QueryParser.php @@ -14,7 +14,7 @@ class NodeResult { public function __construct( public readonly ?Node $node, - public readonly bool $isQueryEnd + public readonly bool $isSubqueryEnd ) { } } @@ -30,6 +30,7 @@ class QueryParser implements QueryParserInterface private string $query; private int $position = 0; + /** @return Node[] */ public function parse(string $query): array { $this->query = $query; @@ -37,6 +38,7 @@ class QueryParser implements QueryParserInterface return $this->parseQuery(false); } + /** @return Node[] */ private function parseQuery(bool $isSubquery): array { $nodes = []; @@ -44,7 +46,7 @@ class QueryParser implements QueryParserInterface while ($nodeResult->node !== null) { $nodes[] = $nodeResult->node; - if($nodeResult->isQueryEnd) { + if($nodeResult->isSubqueryEnd) { break; } $nodeResult = $this->buildNextNode($isSubquery);