getConstants()) as $constant) { self::$constants[$constant] = true; } } return array_keys(self::$constants); } /** * @return void */ #[\ReturnTypeWillChange] public function offsetSet($name, $value) { $constants = self::getConstantValues(); if (is_null($name) || !in_array($name, $constants)) { throw new InvalidArgumentException('MetadataEnvelope fields must' . ' must match a predefined offset; use the header constants.'); } $this->data[$name] = $value; } #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->data; } }