This commit is contained in:
2025-05-12 14:25:25 +02:00
parent ab2db755ef
commit 9e378ca2b7
2719 changed files with 46505 additions and 60181 deletions

View File

@@ -31,15 +31,11 @@ class Token
public const TYPE_NUMBER = 'number';
public const TYPE_STRING = 'string';
private ?string $type;
private ?string $value;
private ?int $position;
public function __construct(?string $type, ?string $value, ?int $position)
{
$this->type = $type;
$this->value = $value;
$this->position = $position;
public function __construct(
private ?string $type,
private ?string $value,
private ?int $position,
) {
}
public function getType(): ?int
@@ -72,7 +68,7 @@ class Token
return true;
}
return \in_array($this->value, $values);
return \in_array($this->value, $values, true);
}
public function isWhitespace(): bool
@@ -103,9 +99,9 @@ class Token
public function __toString(): string
{
if ($this->value) {
return sprintf('<%s "%s" at %s>', $this->type, $this->value, $this->position);
return \sprintf('<%s "%s" at %s>', $this->type, $this->value, $this->position);
}
return sprintf('<%s at %s>', $this->type, $this->position);
return \sprintf('<%s at %s>', $this->type, $this->position);
}
}