Passed
Push — master ( a0ae72...f853f9 )
by Shahrad
02:06
created

WebAppData::subEntities()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace TelegramBot\Entities;
4
5
use TelegramBot\Entity;
6
7
/**
8
 * Class WebAppData
9
 *
10
 * Contains data sent from a Web App to the bot.
11
 *
12
 * @link https://core.telegram.org/bots/api#webappdata
13
 *
14
 * @method string getData()         The data. Be aware that a bad client can send arbitrary data in this field.
15
 * @method string getButtonText()   Text of the web_app keyboard button, from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field.
16
 *
17
 * @method User   getUser()     (Optional). The user who sent the query.
18
 * @method string getHash()     (Optional). Unique identifier for the validating
19
 **/
20
class WebAppData 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