&$metadata */ public function __construct(private array &$metadata) { } public function get(string $key): mixed { if (!$this->isSet($key)) { throw new MissingKeyException($key); } return $this->metadata[$key]; } public function set(string $key, mixed $value): static { $this->metadata[$key] = $value; return $this; } public function isSet(string $key): bool { return array_key_exists($key, $this->metadata); } }