Moved Objects

This commit is contained in:
netkas 2024-10-02 00:18:12 -04:00
parent 848a2a78e3
commit 6c67e97a4b
167 changed files with 368 additions and 373 deletions

View file

@ -0,0 +1,65 @@
<?php
/** @noinspection PhpMissingFieldTypeInspection */
namespace TgBotLib\Objects;
use TgBotLib\Interfaces\ObjectTypeInterface;
class Dice implements ObjectTypeInterface
{
/**
* @var string
*/
private $emoji;
/**
* @var int
*/
private $value;
/**
* @return string
*/
public function getEmoji(): string
{
return $this->emoji;
}
/**
* @return int
*/
public function getValue(): int
{
return $this->value;
}
/**
* Constructs object from array representation
*
* @return array
*/
public function toArray(): array
{
return [
'emoji' => $this->emoji,
'value' => $this->value,
];
}
/**
* Constructs object from array representation
*
* @param array $data
* @return Dice
*/
public static function fromArray(array $data): self
{
$object = new self();
$object->emoji = $data['emoji'] ?? null;
$object->value = $data['value'] ?? null;
return $object;
}
}