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

WebAppInfo   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

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
}