MessageEntity::subEntities()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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