Updated InputMessageContent objects

This commit is contained in:
netkas 2024-10-04 00:14:47 -04:00
parent 9dd11af87d
commit aaacd8851e
5 changed files with 30 additions and 9 deletions

View file

@ -159,10 +159,14 @@
/**
* @inheritDoc
*/
public static function fromArray(array $data): InputContactMessageContent
public static function fromArray(?array $data): ?InputContactMessageContent
{
$object = new self();
if($data === null)
{
return null;
}
$object = new self();
$object->type = InputMessageContentType::CONTACT;
$object->phone_number = $data['phone_number'] ?? null;
$object->first_name = $data['first_name'] ?? null;