Skip to content

Commit 553e2c5

Browse files
authored
Merge pull request #155 from DJTommek/pr/prevent-deprecation-errors
Fixed PHP deprecated dynamic property messages
2 parents dba9442 + bef2f5d commit 553e2c5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Abstracts/TelegramTypes.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use unreal4u\Dummy\Logger;
99
use unreal4u\TelegramAPI\Telegram\Types\Custom\ResultArray;
1010

11+
#[\AllowDynamicProperties]
1112
abstract class TelegramTypes
1213
{
1314
/**
@@ -62,21 +63,19 @@ final protected function populateObject(array $data = []): TelegramTypes
6263
/**
6364
* The default is that we have no subobjects at all, so this function will return nothing
6465
*
65-
* @param string $key
66-
* @param array $data
67-
*
6866
* @return TelegramTypes
6967
*/
7068
protected function mapSubObjects(string $key, array $data): TelegramTypes
7169
{
7270
if (!isset($this->$key)) {
7371
$this->logger->error(sprintf(
74-
'The key "%s" does not exist in the class! Maybe a recent Telegram Bot API update? In any way, please '.
72+
'The key "%s" does not exist in the class %s! Maybe a recent Telegram Bot API update? In any way, please '.
7573
'submit an issue (bug report) at %s with this complete log line',
7674
$key,
77-
'https://github.com/unreal4u/telegram-api/issues'
75+
static::class,
76+
'https://github.com/unreal4u/telegram-api/issues',
7877
), [
79-
'object' => \get_class($this),
78+
'object' => static::class,
8079
'data' => $data,
8180
]);
8281
}

0 commit comments

Comments
 (0)