Updated TextQuote
This commit is contained in:
parent
af7a33b1c1
commit
19333f5876
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue