mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 17:33:45 +00:00
Small QoL additions
This commit is contained in:
@@ -14,7 +14,7 @@ class NodeResult
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
public readonly ?Node $node,
|
public readonly ?Node $node,
|
||||||
public readonly bool $isQueryEnd
|
public readonly bool $isSubqueryEnd
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -30,6 +30,7 @@ class QueryParser implements QueryParserInterface
|
|||||||
private string $query;
|
private string $query;
|
||||||
private int $position = 0;
|
private int $position = 0;
|
||||||
|
|
||||||
|
/** @return Node[] */
|
||||||
public function parse(string $query): array
|
public function parse(string $query): array
|
||||||
{
|
{
|
||||||
$this->query = $query;
|
$this->query = $query;
|
||||||
@@ -37,6 +38,7 @@ class QueryParser implements QueryParserInterface
|
|||||||
return $this->parseQuery(false);
|
return $this->parseQuery(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return Node[] */
|
||||||
private function parseQuery(bool $isSubquery): array
|
private function parseQuery(bool $isSubquery): array
|
||||||
{
|
{
|
||||||
$nodes = [];
|
$nodes = [];
|
||||||
@@ -44,7 +46,7 @@ class QueryParser implements QueryParserInterface
|
|||||||
|
|
||||||
while ($nodeResult->node !== null) {
|
while ($nodeResult->node !== null) {
|
||||||
$nodes[] = $nodeResult->node;
|
$nodes[] = $nodeResult->node;
|
||||||
if($nodeResult->isQueryEnd) {
|
if($nodeResult->isSubqueryEnd) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$nodeResult = $this->buildNextNode($isSubquery);
|
$nodeResult = $this->buildNextNode($isSubquery);
|
||||||
|
Reference in New Issue
Block a user