MessageEntity   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 3
dl 0
loc 10
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A subEntities() 0 4 1
1
<?php
2
3
4
namespace TelegramBot\Entities;
5
6
use TelegramBot\Entity;
7
8
/**
9
 * Class MessageEntity
10
 *
11
 * @link https://core.telegram.org/bots/api#messageentity
12
 *
13
 * @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)
14
 * @method int    getOffset()       Offset in UTF-16 code units to the start of the entity
15
 * @method int    getLength()       Length of the entity in UTF-16 code units
16
 * @method string getUrl()          Optional. For "text_link" only, url that will be opened after user taps on the text
17
 * @method User   getUser()         Optional. For "text_mention" only, the mentioned user
18
 * @method string getLanguage()     Optional. For "pre" only, the programming language of the entity text
19
 */
20
class MessageEntity extends Entity
21
{
22
23
    /**
24
     * {@inheritdoc}
25
     */
26
    protected function subEntities(): array
27
    {
28
        return [
29
            'user' => User::class,
30
        ];
31
    }
32
33
}
34