From 208d28ba59bd3f6008b688720981c453726fed6a Mon Sep 17 00:00:00 2001 From: Max Gorovenko Date: Mon, 29 Nov 2021 13:05:46 +0300 Subject: [PATCH] PHP 8.1 deprecations fix --- src/Entities/Message.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Entities/Message.php b/src/Entities/Message.php index 634ad7dd..ea6eeea5 100644 --- a/src/Entities/Message.php +++ b/src/Entities/Message.php @@ -158,7 +158,7 @@ public function getCommand(): ?string } $full_command = $this->getFullCommand(); - if (strpos($full_command, '/') !== 0) { + if (!is_string($full_command) || strpos($full_command, '/') !== 0) { return null; } $full_command = substr($full_command, 1); @@ -261,7 +261,7 @@ public function getType(): string 'reply_markup', ]; - $is_command = strlen($this->getCommand()) > 0; + $is_command = is_string($command = $this->getCommand()) && strlen($command) > 0; foreach ($types as $type) { if ($this->getProperty($type) !== null) { if ($is_command && $type === 'text') {