$params */ private function __construct(private readonly array $params) { // .. } /** * Creates a new Query Params value object */ public static function create(): self { return new self([]); } /** * Creates a new Query Params value object, with the newly added param, and the existing params. */ public function withParam(string $name, string|int $value): self { return new self([ ...$this->params, $name => $value, ]); } /** * @return array */ public function toArray(): array { return $this->params; } }