field; } /** * @return array> */ public function toArray(): array { $body = [ 'order' => $this->type, 'missing' => $this->missing, ]; if ($this->mode !== null) { $body['mode'] = $this->mode; } if ($this->nested !== null) { $body['nested'] = $this->nested->toArray(); } if ($this->numericType !== null) { $body['numeric_type'] = $this->numericType; } if ($this->unmappedType !== null) { $body['unmapped_type'] = $this->unmappedType; } if ($this->format !== null) { $body['format'] = $this->format; } return [ $this->field => $body, ]; } }