Файл: upload/core/vendor/longman/telegram-bot/src/Entities/ChatBoostSource/Factory.php
Строк: 25
<?php
namespace LongmanTelegramBotEntitiesChatBoostSource;
use LongmanTelegramBotEntitiesEntity;
class Factory extends LongmanTelegramBotEntitiesFactory
{
public static function make(array $data, string $bot_username): Entity
{
$type = [
'premium' => ChatBoostSourcePremium::class,
'gift_code' => ChatBoostSourceGiftCode::class,
'giveaway' => ChatBoostSourceGiveaway::class,
];
if (!isset($type[$data['source'] ?? ''])) {
return new ChatBoostSourceNotImplemented($data, $bot_username);
}
$class = $type[$data['source']];
return new $class($data, $bot_username);
}
}