version = $version; } /** * Returns a string representation of this object. * @return string The string representation of this object. */ function __toString(): string { $json = json_encode($this, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); return static::class." $json"; } /** * Creates a new server version from the specified JSON map. * @param object $map A JSON map representing a server version. * @return static The instance corresponding to the specified JSON map. */ static function fromJson(object $map): self { return new static(isset($map->version) && is_string($map->version) ? $map->version : ''); } /** * Gets the version number. * @return string The version number. */ function getVersion(): string { return $this->version; } /** * Converts this object to a map in JSON format. * @return \stdClass The map in JSON format corresponding to this object. */ function jsonSerialize(): \stdClass { return (object) ['version' => $this->getVersion()]; } }