Passed
Push — master ( 9c7b82...f78b46 )
by Shahrad
02:20
created

WebAppInfo::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
c 0
b 0
f 0
nc 2
nop 1
dl 0
loc 7
rs 10
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
}