metadata = $metadata; } public function get(string $key, mixed $default = null): mixed { return $this->metadata[$key] ?? $default; } public function with(string $key, mixed $value): self { $metadata = $this->metadata; $metadata[$key] = $value; return new self($metadata); } }