Files
firefly-iii/app/Support/Search/QueryParser/Word.php

30 lines
615 B
PHP
Raw Normal View History

2025-01-02 22:17:56 +01:00
<?php
declare(strict_types=1);
namespace FireflyIII\Support\Search\QueryParser;
/**
* Represents a word in the search query, meaning either a single-word without spaces or a quote-delimited string
*/
class Word extends Node
{
private string $value;
public function __construct(string $value, bool $prohibited = false)
{
$this->value = $value;
$this->prohibited = $prohibited;
}
public function getValue(): string
{
return $this->value;
}
public function __toString(): string
{
return ($this->prohibited ? '-' : '') . $this->value;
}
}