mirror of
https://github.com/sitelease/sugar-cube-client.git
synced 2025-10-31 20:12:29 +01:00
26 lines
593 B
PHP
26 lines
593 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
namespace Gitea\Models;
|
|
|
|
/**
|
|
* Warps the version of the Gitea server.
|
|
*/
|
|
class ServerVersion {
|
|
|
|
/**
|
|
* @var string The version number.
|
|
*/
|
|
public $version = '';
|
|
|
|
/**
|
|
* 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([
|
|
'version' => isset($map->version) && is_string($map->version) ? $map->version : ''
|
|
]);
|
|
}
|
|
}
|