mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
30 lines
615 B
PHP
30 lines
615 B
PHP
<?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;
|
|
}
|
|
}
|