Page MenuHomePhabricator (Chris)

Factory.php
No OneTemporary

Authored By
Unknown
Size
659 B
Referenced Files
None
Subscribers
None

Factory.php

<?php
namespace Longman\TelegramBot\Entities\MenuButton;
use Longman\TelegramBot\Entities\Entity;
class Factory extends \Longman\TelegramBot\Entities\Factory
{
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);
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Nov 14, 4:54 PM (10 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
128745
Default Alt Text
Factory.php (659 B)

Event Timeline