Skip to content

Commit 208d28b

Browse files
committed
PHP 8.1 deprecations fix
1 parent feba9d7 commit 208d28b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Entities/Message.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public function getCommand(): ?string
158158
}
159159

160160
$full_command = $this->getFullCommand();
161-
if (strpos($full_command, '/') !== 0) {
161+
if (!is_string($full_command) || strpos($full_command, '/') !== 0) {
162162
return null;
163163
}
164164
$full_command = substr($full_command, 1);
@@ -261,7 +261,7 @@ public function getType(): string
261261
'reply_markup',
262262
];
263263

264-
$is_command = strlen($this->getCommand()) > 0;
264+
$is_command = is_string($command = $this->getCommand()) && strlen($command) > 0;
265265
foreach ($types as $type) {
266266
if ($this->getProperty($type) !== null) {
267267
if ($is_command && $type === 'text') {

0 commit comments

Comments
 (0)