Passed
Push — master ( ba4305...0eea94 )
by Armando
13:01 queued 03:00
created

MenuButtonWebApp   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A subEntities() 0 4 1
A __construct() 0 4 1
1
<?php
2
3
namespace Longman\TelegramBot\Entities\MenuButton;
4
5
use Longman\TelegramBot\Entities\WebAppInfo;
6
7
/**
8
 * Represents a menu button, which launches a Web App.
9
 *
10
 * @method string     getText()   Text on the button
11
 * @method WebAppInfo getWebApp() Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery.
12
 *
13
 * @method $this setText(string $text)          Text on the button
14
 * @method $this setWebApp(WebAppInfo $web_app) Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery.
15
 */
16
class MenuButtonWebApp extends MenuButton
17
{
18
    public function __construct(array $data)
19
    {
20
        $data['type'] = 'web_app';
21
        parent::__construct($data);
22
    }
23
24
    protected function subEntities(): array
25
    {
26
        return [
27
            'web_app' => WebAppInfo::class,
28
        ];
29
    }
30
31
32
}
33