Completed
Push — master ( d60737...066901 )
by Nikolay
19s queued 12s
created

WebAppInfoType::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 3
c 1
b 0
f 1
dl 0
loc 6
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace TgBotApi\BotApiBase\Type;
6
7
use TgBotApi\BotApiBase\Exception\BadArgumentException;
8
9
/**
10
 * Class MenuButtonType.
11
 *
12
 * @see https://core.telegram.org/bots/api#webappinfo
13
 */
14
class WebAppInfoType
15
{
16
    /**
17
     * An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps
18
     *
19
     * @var string
20
     */
21
    public $url;
22
23
    /**
24
     * @param string     $url
25
     *
26
     * @throws BadArgumentException
27
     *
28
     * @return WebAppInfoType
29
     */
30
    public static function create(string $url): WebAppInfoType
31
    {
32
        $instance = new static();
33
        $instance->url = $url;
34
35
        return $instance;
36
    }
37
}
38