Updated ChatShared

This commit is contained in:
netkas 2024-10-04 15:01:33 -04:00
parent bc1000fa1d
commit 746201b395

View file

@ -7,15 +7,8 @@
class ChatShared implements ObjectTypeInterface class ChatShared implements ObjectTypeInterface
{ {
/** private int $request_id;
* @var int private int $chat_id;
*/
private $request_id;
/**
* @var int
*/
private $chat_id;
/** /**
* Identifier of the request * Identifier of the request
@ -42,9 +35,7 @@
} }
/** /**
* Returns an array representation of the object. * @inheritDoc
*
* @return array
*/ */
public function toArray(): array public function toArray(): array
{ {
@ -55,15 +46,16 @@
} }
/** /**
* Constructs object from an array representation * @inheritDoc
*
* @param array $data
* @return ChatShared
*/ */
public static function fromArray(array $data): self public static function fromArray(?array $data): ?ChatShared
{ {
$object = new self(); if($data === null)
{
return null;
}
$object = new self();
$object->request_id = $data['request_id'] ?? null; $object->request_id = $data['request_id'] ?? null;
$object->chat_id = $data['chat_id'] ?? null; $object->chat_id = $data['chat_id'] ?? null;