Файл: upload/core/vendor/longman/telegram-bot/src/Entities/MenuButton/Factory.php
Строк: 37
<?php
namespace LongmanTelegramBotEntitiesMenuButton;
use LongmanTelegramBotEntitiesEntity;
class Factory extends LongmanTelegramBotEntitiesFactory
{
public static function make(array $data, string $bot_username): Entity
{
$type = [
'commands' => MenuButtonCommands::class,
'web_app' => MenuButtonWebApp::class,
'default' => MenuButtonDefault::class,
];
if (! isset($type[$data['type'] ?? ''])) {
return new MenuButtonNotImplemented($data, $bot_username);
}
$class = $type[$data['type']];
return new $class($data, $bot_username);
}
}