MessageEntity::subEntities()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of the TelegramBot package.
5
 *
6
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Longman\TelegramBot\Entities;
13
14
/**
15
 * Class MessageEntity
16
 *
17
 * @link https://core.telegram.org/bots/api#messageentity
18
 *
19
 * @method string getType()     Type of the entity. Can be 'mention' (@username), 'hashtag' (#hashtag), 'cashtag' ($USD), 'bot_command' (/start@jobs_bot), 'url' (https://telegram.org), 'email' ([email protected]), 'phone_number' (+1-212-555-0123), 'bold' (bold text), 'italic' (italic text), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users without usernames)
20
 * @method int    getOffset()   Offset in UTF-16 code units to the start of the entity
21
 * @method int    getLength()   Length of the entity in UTF-16 code units
22
 * @method string getUrl()      Optional. For "text_link" only, url that will be opened after user taps on the text
23
 * @method User   getUser()     Optional. For "text_mention" only, the mentioned user
24
 * @method string getLanguage() Optional. For "pre" only, the programming language of the entity text
25
 */
26
class MessageEntity extends Entity
27
{
28
    /**
29
     * {@inheritdoc}
30
     */
31
    protected function subEntities(): array
32
    {
33
        return [
34
            'user' => User::class,
35
        ];
36
    }
37
}
38