type = $type; $this->value = $value; } public function value(): string { return $this->value; } public function type(): int { return $this->type; } public function isOfType(int ...$types): bool { return in_array($this->type, $types, true); } public function hasExtraWhitespace(): bool { return strpos($this->value(), ' ') !== false || strpos($this->value(), "\n") !== false || strpos($this->value(), "\t") !== false; } public function withValue(string $value): self { return new self($this->type(), $value); } }