52 lines
No EOL
1.1 KiB
PHP
52 lines
No EOL
1.1 KiB
PHP
<?php
|
|
|
|
/** @noinspection PhpMissingFieldTypeInspection */
|
|
|
|
namespace TgBotLib\Objects\BotCommandScope;
|
|
|
|
use TgBotLib\Interfaces\ObjectTypeInterface;
|
|
|
|
class BotCommandScopeChatAdministrators implements ObjectTypeInterface
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $type;
|
|
|
|
/**
|
|
* Scope type, must be chat_administrators
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getType(): string
|
|
{
|
|
return $this->type;
|
|
}
|
|
|
|
/**
|
|
* Returns an array representation of the object
|
|
*
|
|
* @return array
|
|
*/
|
|
public function toArray(): array
|
|
{
|
|
return [
|
|
'type' => $this->type
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Constructs object from an array representation
|
|
*
|
|
* @param array $data
|
|
* @return ObjectTypeInterface
|
|
*/
|
|
public static function fromArray(array $data): ObjectTypeInterface
|
|
{
|
|
$object = new self();
|
|
|
|
$object->type = $data['type'];
|
|
|
|
return $object;
|
|
}
|
|
} |