mirror of
https://github.com/sitelease/sugar-cube-client.git
synced 2025-10-31 20:12:29 +01:00
Added new models
This commit is contained in:
25
lib/models/ServerVersion.php
Normal file
25
lib/models/ServerVersion.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?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 : ''
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user