Added new models

This commit is contained in:
Cédric Belin
2018-11-02 00:04:16 +01:00
parent 61625a700e
commit a5f84778cd
5 changed files with 503 additions and 0 deletions

View 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 : ''
]);
}
}