Updated InputMessageContent objects
This commit is contained in:
parent
9dd11af87d
commit
aaacd8851e
5 changed files with 30 additions and 9 deletions
|
@ -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;
|
||||
|
|
|
@ -609,10 +609,14 @@
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function fromArray(array $data): InputInvoiceMessageContent
|
||||
public static function fromArray(?array $data): ?InputInvoiceMessageContent
|
||||
{
|
||||
$object = new self();
|
||||
if($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$object = new self();
|
||||
$object->type = InputMessageContentType::INVOICE;
|
||||
$object->title = $data['title'] ?? null;
|
||||
$object->description = $data['description'] ?? null;
|
||||
|
|
|
@ -217,10 +217,14 @@
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function fromArray(array $data): InputLocationMessageContent
|
||||
public static function fromArray(?array $data): ?InputLocationMessageContent
|
||||
{
|
||||
$object = new self();
|
||||
if($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$object = new self();
|
||||
$object->type = InputMessageContentType::LOCATION;
|
||||
$object->latitude = (float)$data['latitude'] ?? null;
|
||||
$object->longitude = (float)$data['longitude'] ?? null;
|
||||
|
|
|
@ -179,10 +179,14 @@
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function fromArray(array $data): InputTextMessageContent
|
||||
public static function fromArray(?array $data): ?InputTextMessageContent
|
||||
{
|
||||
$object = new self();
|
||||
if($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$object = new self();
|
||||
$object->type = InputMessageContentType::TEXT;
|
||||
$object->message_text = $data['message_text'] ?? null;
|
||||
$object->parse_mode = $data['parse_mode'] ?? null;
|
||||
|
|
|
@ -227,8 +227,13 @@
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function fromArray(array $data): InputVenueMessageContent
|
||||
public static function fromArray(?array $data): ?InputVenueMessageContent
|
||||
{
|
||||
if($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$object = new self();
|
||||
$object->type = InputMessageContentType::VENUE;
|
||||
$object->latitude = (float)$data['latitude'] ?? null;
|
||||
|
|
Loading…
Add table
Reference in a new issue