Passed
Push — master ( 4c2b59...061776 )
by Shahrad
02:09
created

WebAppInfo   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 10
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
1
<?php
2
3
namespace TelegramBot\Entities;
4
5
use TelegramBot\Entity;
6
7
/**
8
 * WebAppInfo
9
 *
10
 * Contains information about a Web App.
11
 *
12
 * @link https://core.telegram.org/bots/api#webappinfo
13
 *
14
 * @property string $url    An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps
15
 *
16
 * @method string getUrl()              An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps
17
 * @method $this setUrl(string $url)    An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps
18
 */
19
class WebAppInfo extends Entity
20
{
21
22
    public function __construct($data)
23
    {
24
        if (is_string($data)) {
25
            $data = ['url' => $data];
26
        }
27
28
        parent::__construct($data);
29
    }
30
31
}