|null $_meta @since 2025-06-18 */ public function __construct( string $uri, string $text, ?string $mimeType = null, ?array $_meta = null ) { parent::__construct($uri, $mimeType, $_meta); $this->text = $text; } /** * Creates an instance from an array. * * @param array{ * uri: string, * mimeType?: string|null, * _meta?: array|null, * text: string * } $data * @phpstan-param array $data * @return self */ public static function fromArray(array $data): self { self::assertRequired($data, ['uri', 'text']); return new self( self::asString($data['uri']), self::asString($data['text']), self::asStringOrNull($data['mimeType'] ?? null), self::asArrayOrNull($data['_meta'] ?? null) ); } /** * Converts the instance to an array. * * @return array */ public function toArray(): array { $result = parent::toArray(); $result['text'] = $this->text; return $result; } /** * @return string */ public function getText(): string { return $this->text; } }