Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F623028
Factory.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
850 B
Referenced Files
None
Subscribers
None
Factory.php
View Options
<?php
namespace
Longman
\
TelegramBot
\
Entities
\
ChatMember
;
use
Longman
\
TelegramBot
\
Entities
\
Entity
;
class
Factory
extends
\
Longman
\
TelegramBot
\
Entities
\
Factory
{
public
static
function
make
(
array
$data
,
string
$bot_username
)
:
Entity
{
$type
=
[
'creator'
=>
ChatMemberOwner
::
class
,
'administrator'
=>
ChatMemberAdministrator
::
class
,
'member'
=>
ChatMemberMember
::
class
,
'restricted'
=>
ChatMemberRestricted
::
class
,
'left'
=>
ChatMemberLeft
::
class
,
'kicked'
=>
ChatMemberBanned
::
class
,
]
;
if
(
!
isset
(
$type
[
$data
[
'status'
]
??
''
]
)
)
{
return
new
ChatMemberNotImplemented
(
$data
,
$bot_username
)
;
}
$class
=
$type
[
$data
[
'status'
]
]
;
return
new
$class
(
$data
,
$bot_username
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 14, 8:48 PM (1 d, 2 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
141089
Default Alt Text
Factory.php (850 B)
Attached To
Mode
R123 php-telegram-bot
Attached
Detach File
Event Timeline