diff --git a/metadata/JikanPHP.Model.Common.HistoryMeta.yml b/metadata/JikanPHP.Model.Common.HistoryMeta.yml new file mode 100644 index 0000000..26ef719 --- /dev/null +++ b/metadata/JikanPHP.Model.Common.HistoryMeta.yml @@ -0,0 +1,10 @@ +JikanPHP\Model\Common\HistoryMeta: + properties: + malId: + type: int + type: + type: string + name: + type: string + url: + type: string diff --git a/metadata/JikanPHP.Model.User.History.yml b/metadata/JikanPHP.Model.User.History.yml index 305af7c..9ed51e5 100644 --- a/metadata/JikanPHP.Model.User.History.yml +++ b/metadata/JikanPHP.Model.User.History.yml @@ -1,7 +1,7 @@ JikanPHP\Model\User\History: properties: - malUrl: - type: JikanPHP\Model\Common\MalUrl + meta: + type: JikanPHP\Model\Common\HistoryMeta increment: type: int date: diff --git a/model/Common/HistoryMeta.php b/model/Common/HistoryMeta.php new file mode 100644 index 0000000..1f33b93 --- /dev/null +++ b/model/Common/HistoryMeta.php @@ -0,0 +1,64 @@ +url; + } + + /** + * @return int + */ + public function getMalId(): int + { + return $this->malId; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @return string + */ + public function getName(): string + { + return $this->name; + } +} diff --git a/model/User/History.php b/model/User/History.php index b0ec3db..29232e6 100644 --- a/model/User/History.php +++ b/model/User/History.php @@ -2,7 +2,7 @@ namespace JikanPHP\Model\User; -use JikanPHP\Model\Common\MalUrl; +use JikanPHP\Model\Common\HistoryMeta; /** * Class History @@ -11,11 +11,10 @@ */ class History { - /** - * @var MalUrl + * @var HistoryMeta */ - private $malUrl; + private HistoryMeta $meta; /** * @var int @@ -27,14 +26,6 @@ class History */ private $date; - /** - * @return MalUrl - */ - public function getMalUrl(): MalUrl - { - return $this->malUrl; - } - /** * @return int */ @@ -50,4 +41,12 @@ public function getDate(): \DateTimeImmutable { return $this->date; } + + /** + * @return HistoryMeta + */ + public function getMeta(): HistoryMeta + { + return $this->meta; + } }