From 19333f587629f33e095b58aa8ca8780f5dfe9204 Mon Sep 17 00:00:00 2001 From: netkas Date: Sat, 5 Oct 2024 00:55:41 -0400 Subject: [PATCH] Updated TextQuote --- src/TgBotLib/Objects/TextQuote.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/TgBotLib/Objects/TextQuote.php b/src/TgBotLib/Objects/TextQuote.php index 04c1c15..8ca2188 100644 --- a/src/TgBotLib/Objects/TextQuote.php +++ b/src/TgBotLib/Objects/TextQuote.php @@ -2,6 +2,7 @@ namespace TgBotLib\Objects; +use SebastianBergmann\CodeCoverage\Report\Text; use TgBotLib\Interfaces\ObjectTypeInterface; class TextQuote implements ObjectTypeInterface @@ -69,10 +70,14 @@ class TextQuote implements ObjectTypeInterface /** * @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->entities = $data['entities'] ?? null; $object->position = $data['position'] ?? null;