Update more code.

This commit is contained in:
James Cole
2025-05-04 13:04:33 +02:00
parent abd9260193
commit e42107c03c
55 changed files with 106 additions and 278 deletions

View File

@@ -30,13 +30,8 @@ namespace FireflyIII\Support\Search\QueryParser;
*/
class FieldNode extends Node
{
private string $operator;
private string $value;
public function __construct(string $operator, string $value, bool $prohibited = false)
public function __construct(private readonly string $operator, private readonly string $value, bool $prohibited = false)
{
$this->operator = $operator;
$this->value = $value;
$this->prohibited = $prohibited;
}

View File

@@ -33,7 +33,7 @@ use Illuminate\Support\Facades\Log;
class GdbotsQueryParser implements QueryParserInterface
{
private BaseQueryParser $parser;
private readonly BaseQueryParser $parser;
public function __construct()
{
@@ -98,7 +98,7 @@ class GdbotsQueryParser implements QueryParserInterface
default:
throw new FireflyException(
sprintf('Unsupported node type: %s', get_class($node))
sprintf('Unsupported node type: %s', $node::class)
);
}
}

View File

@@ -32,15 +32,11 @@ namespace FireflyIII\Support\Search\QueryParser;
*/
class NodeGroup extends Node
{
/** @var Node[] */
private array $nodes;
/**
* @param Node[] $nodes
*/
public function __construct(array $nodes, bool $prohibited = false)
public function __construct(private readonly array $nodes, bool $prohibited = false)
{
$this->nodes = $nodes;
$this->prohibited = $prohibited;
}

View File

@@ -30,11 +30,8 @@ namespace FireflyIII\Support\Search\QueryParser;
*/
class StringNode extends Node
{
private string $value;
public function __construct(string $value, bool $prohibited = false)
public function __construct(private readonly string $value, bool $prohibited = false)
{
$this->value = $value;
$this->prohibited = $prohibited;
}