Updated classes fromArray signatures (in-progress)
This commit is contained in:
parent
59f6875edf
commit
dfb812237b
43 changed files with 288 additions and 75 deletions
|
@ -26,9 +26,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns an array representation of the object
|
||||
*
|
||||
* @return array
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
|
@ -39,13 +37,15 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructs object from an array representation
|
||||
*
|
||||
* @param array $data
|
||||
* @return BotCommandScopeAllChatAdministrators
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function fromArray(array $data): BotCommandScopeAllChatAdministrators
|
||||
public static function fromArray(?array $data): ?BotCommandScopeAllChatAdministrators
|
||||
{
|
||||
if($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$object = new self();
|
||||
$object->type = BotCommandScopeType::ALL_CHAT_ADMINISTRATORS;
|
||||
$object->chat_id = $data['chat_id'] ?? null;
|
||||
|
|
|
@ -23,8 +23,13 @@
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function fromArray(array $data): self
|
||||
public static function fromArray(?array $data): ?BotCommandScopeAllGroupChats
|
||||
{
|
||||
if($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$object = new self();
|
||||
$object->type = BotCommandScopeType::ALL_CHAT_GROUPS;
|
||||
|
||||
|
|
|
@ -23,8 +23,13 @@
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function fromArray(array $data): BotCommandScopeAllPrivateChats
|
||||
public static function fromArray(?array $data): ?BotCommandScopeAllPrivateChats
|
||||
{
|
||||
if($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$object = new self();
|
||||
$object->type = BotCommandScopeType::ALL_PRIVATE_CHATS;
|
||||
|
||||
|
|
|
@ -39,8 +39,13 @@
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function fromArray(array $data): self
|
||||
public static function fromArray(?array $data): ?BotCommandScopeChat
|
||||
{
|
||||
if($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$object = new self();
|
||||
$object->type = BotCommandScopeType::CHAT;
|
||||
$object->chat_id = $data['chat_id'] ?? null;
|
||||
|
|
|
@ -24,8 +24,13 @@
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function fromArray(array $data): self
|
||||
public static function fromArray(?array $data): ?BotCommandScopeChatAdministrators
|
||||
{
|
||||
if($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$object = new self();
|
||||
$object->type = BotCommandScopeType::CHAT_ADMINISTRATORS;
|
||||
|
||||
|
|
|
@ -48,8 +48,13 @@
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function fromArray(array $data): self
|
||||
public static function fromArray(?array $data): ?BotCommandScopeChatMember
|
||||
{
|
||||
if($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$object = new self();
|
||||
$object->type = BotCommandScopeType::CHAT_MEMBER;
|
||||
$object->chat_id = $data['chat_id'] ?? null;
|
||||
|
|
|
@ -23,8 +23,13 @@
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function fromArray(array $data): BotCommandScopeDefault
|
||||
public static function fromArray(?array $data): ?BotCommandScopeDefault
|
||||
{
|
||||
if($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$object = new self();
|
||||
$object->type = BotCommandScopeType::DEFAULT;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue