| Total Complexity | 5 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class AddRecentSticker extends TdFunction |
||
| 15 | { |
||
| 16 | public const TYPE_NAME = 'addRecentSticker'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Pass true to add the sticker to the list of stickers recently attached to photo or video files; pass false to add the sticker to the list of recently sent stickers. |
||
| 20 | */ |
||
| 21 | protected bool $isAttached; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Sticker file to add. |
||
| 25 | */ |
||
| 26 | protected InputFile $sticker; |
||
| 27 | |||
| 28 | public function __construct(bool $isAttached, InputFile $sticker) |
||
| 29 | { |
||
| 30 | $this->isAttached = $isAttached; |
||
| 31 | $this->sticker = $sticker; |
||
| 32 | } |
||
| 33 | |||
| 34 | public static function fromArray(array $array): AddRecentSticker |
||
| 35 | { |
||
| 36 | return new static( |
||
| 37 | $array['is_attached'], |
||
| 38 | TdSchemaRegistry::fromArray($array['sticker']), |
||
| 39 | ); |
||
| 40 | } |
||
| 41 | |||
| 42 | public function typeSerialize(): array |
||
| 43 | { |
||
| 44 | return [ |
||
| 45 | '@type' => static::TYPE_NAME, |
||
| 46 | 'is_attached' => $this->isAttached, |
||
| 47 | 'sticker' => $this->sticker->typeSerialize(), |
||
| 48 | ]; |
||
| 49 | } |
||
| 50 | |||
| 51 | public function getIsAttached(): bool |
||
| 54 | } |
||
| 55 | |||
| 56 | public function getSticker(): InputFile |
||
| 59 | } |
||
| 60 | } |
||
| 61 |