Updated TextQuote

This commit is contained in:
netkas 2024-10-05 00:55:41 -04:00
parent af7a33b1c1
commit 19333f5876

View file

@ -2,6 +2,7 @@
namespace TgBotLib\Objects; namespace TgBotLib\Objects;
use SebastianBergmann\CodeCoverage\Report\Text;
use TgBotLib\Interfaces\ObjectTypeInterface; use TgBotLib\Interfaces\ObjectTypeInterface;
class TextQuote implements ObjectTypeInterface class TextQuote implements ObjectTypeInterface
@ -69,10 +70,14 @@ class TextQuote implements ObjectTypeInterface
/** /**
* @inheritDoc * @inheritDoc
*/ */
public static function fromArray(array $data): ObjectTypeInterface public static function fromArray(?array $data): ?TextQuote
{ {
$object = new self(); if($data === null)
{
return null;
}
$object = new self();
$object->text = $data['text']; $object->text = $data['text'];
$object->entities = $data['entities'] ?? null; $object->entities = $data['entities'] ?? null;
$object->position = $data['position'] ?? null; $object->position = $data['position'] ?? null;