@@ -9,26 +9,26 @@ |
||
9 | 9 | * front side of the document changes. |
10 | 10 | */ |
11 | 11 | class passportElementErrorFrontSide extends types { |
12 | - /** Keep all of properties which has sub properties */ |
|
13 | - private const subs = []; |
|
12 | + /** Keep all of properties which has sub properties */ |
|
13 | + private const subs = []; |
|
14 | 14 | |
15 | - /** Error source, must be front_side */ |
|
16 | - public string $source; |
|
15 | + /** Error source, must be front_side */ |
|
16 | + public string $source; |
|
17 | 17 | |
18 | - /** |
|
19 | - * The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, |
|
20 | - * “identity_card”, “internal_passport” |
|
21 | - */ |
|
22 | - public string $type; |
|
18 | + /** |
|
19 | + * The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, |
|
20 | + * “identity_card”, “internal_passport” |
|
21 | + */ |
|
22 | + public string $type; |
|
23 | 23 | |
24 | - /** Base64-encoded hash of the file with the front side of the document */ |
|
25 | - public string $file_hash; |
|
24 | + /** Base64-encoded hash of the file with the front side of the document */ |
|
25 | + public string $file_hash; |
|
26 | 26 | |
27 | - /** Error message */ |
|
28 | - public string $message; |
|
27 | + /** Error message */ |
|
28 | + public string $message; |
|
29 | 29 | |
30 | 30 | |
31 | - public function __construct(stdClass $update) { |
|
32 | - parent::__construct($update, self::subs); |
|
33 | - } |
|
31 | + public function __construct(stdClass $update) { |
|
32 | + parent::__construct($update, self::subs); |
|
33 | + } |
|
34 | 34 | } |
@@ -8,22 +8,22 @@ |
||
8 | 8 | * base class of all type classes |
9 | 9 | */ |
10 | 10 | class types { |
11 | - public function __toString(): string { |
|
12 | - return json_encode($this); |
|
13 | - } |
|
11 | + public function __toString(): string { |
|
12 | + return json_encode($this); |
|
13 | + } |
|
14 | 14 | |
15 | 15 | |
16 | - public function __construct(stdClass $update, array $subs = []) { |
|
17 | - foreach ($update as $key=>$value) { |
|
18 | - if (isset($subs[$key])) { |
|
19 | - $this->$key = new ($subs[$key]) ($value); |
|
20 | - } |
|
21 | - else { |
|
22 | - $this->$key = $value; |
|
23 | - if (ucfirst($key) === basename(get_class($this)).'_id') { |
|
24 | - $this->{'id'} = $value; |
|
25 | - } |
|
26 | - } |
|
27 | - } |
|
28 | - } |
|
16 | + public function __construct(stdClass $update, array $subs = []) { |
|
17 | + foreach ($update as $key=>$value) { |
|
18 | + if (isset($subs[$key])) { |
|
19 | + $this->$key = new ($subs[$key]) ($value); |
|
20 | + } |
|
21 | + else { |
|
22 | + $this->$key = $value; |
|
23 | + if (ucfirst($key) === basename(get_class($this)).'_id') { |
|
24 | + $this->{'id'} = $value; |
|
25 | + } |
|
26 | + } |
|
27 | + } |
|
28 | + } |
|
29 | 29 | } |
@@ -17,8 +17,7 @@ |
||
17 | 17 | foreach ($update as $key=>$value) { |
18 | 18 | if (isset($subs[$key])) { |
19 | 19 | $this->$key = new ($subs[$key]) ($value); |
20 | - } |
|
21 | - else { |
|
20 | + } else { |
|
22 | 21 | $this->$key = $value; |
23 | 22 | if (ucfirst($key) === basename(get_class($this)).'_id') { |
24 | 23 | $this->{'id'} = $value; |
@@ -8,10 +8,10 @@ |
||
8 | 8 | * This object describes the bot's menu button in a private chat. It should be one of |
9 | 9 | */ |
10 | 10 | class menuButton extends types { |
11 | - /** Keep all of properties which has sub properties */ |
|
12 | - private const subs = []; |
|
11 | + /** Keep all of properties which has sub properties */ |
|
12 | + private const subs = []; |
|
13 | 13 | |
14 | - public function __construct(stdClass $update) { |
|
15 | - parent::__construct($update, self::subs); |
|
16 | - } |
|
14 | + public function __construct(stdClass $update) { |
|
15 | + parent::__construct($update, self::subs); |
|
16 | + } |
|
17 | 17 | } |
@@ -8,23 +8,23 @@ |
||
8 | 8 | * Represents an issue in an unspecified place. The error is considered resolved when new data is added. |
9 | 9 | */ |
10 | 10 | class passportElementErrorUnspecified extends types { |
11 | - /** Keep all of properties which has sub properties */ |
|
12 | - private const subs = []; |
|
11 | + /** Keep all of properties which has sub properties */ |
|
12 | + private const subs = []; |
|
13 | 13 | |
14 | - /** Error source, must be unspecified */ |
|
15 | - public string $source; |
|
14 | + /** Error source, must be unspecified */ |
|
15 | + public string $source; |
|
16 | 16 | |
17 | - /** Type of element of the user's Telegram Passport which has the issue */ |
|
18 | - public string $type; |
|
17 | + /** Type of element of the user's Telegram Passport which has the issue */ |
|
18 | + public string $type; |
|
19 | 19 | |
20 | - /** Base64-encoded element hash */ |
|
21 | - public string $element_hash; |
|
20 | + /** Base64-encoded element hash */ |
|
21 | + public string $element_hash; |
|
22 | 22 | |
23 | - /** Error message */ |
|
24 | - public string $message; |
|
23 | + /** Error message */ |
|
24 | + public string $message; |
|
25 | 25 | |
26 | 26 | |
27 | - public function __construct(stdClass $update) { |
|
28 | - parent::__construct($update, self::subs); |
|
29 | - } |
|
27 | + public function __construct(stdClass $update) { |
|
28 | + parent::__construct($update, self::subs); |
|
29 | + } |
|
30 | 30 | } |
@@ -8,32 +8,32 @@ |
||
8 | 8 | * This object describes the position on faces where a mask should be placed by default. |
9 | 9 | */ |
10 | 10 | class maskPosition extends types { |
11 | - /** Keep all of properties which has sub properties */ |
|
12 | - private const subs = []; |
|
13 | - |
|
14 | - /** |
|
15 | - * The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, |
|
16 | - * “mouth”, or “chin”. |
|
17 | - */ |
|
18 | - public string $point; |
|
19 | - |
|
20 | - /** |
|
21 | - * Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, |
|
22 | - * choosing -1.0 will place mask just to the left of the default mask position. |
|
23 | - */ |
|
24 | - public float $x_shift; |
|
25 | - |
|
26 | - /** |
|
27 | - * Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 |
|
28 | - * will place the mask just below the default mask position. |
|
29 | - */ |
|
30 | - public float $y_shift; |
|
31 | - |
|
32 | - /** Mask scaling coefficient. For example, 2.0 means double size. */ |
|
33 | - public float $scale; |
|
34 | - |
|
35 | - |
|
36 | - public function __construct(stdClass $update) { |
|
37 | - parent::__construct($update, self::subs); |
|
38 | - } |
|
11 | + /** Keep all of properties which has sub properties */ |
|
12 | + private const subs = []; |
|
13 | + |
|
14 | + /** |
|
15 | + * The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, |
|
16 | + * “mouth”, or “chin”. |
|
17 | + */ |
|
18 | + public string $point; |
|
19 | + |
|
20 | + /** |
|
21 | + * Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, |
|
22 | + * choosing -1.0 will place mask just to the left of the default mask position. |
|
23 | + */ |
|
24 | + public float $x_shift; |
|
25 | + |
|
26 | + /** |
|
27 | + * Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 |
|
28 | + * will place the mask just below the default mask position. |
|
29 | + */ |
|
30 | + public float $y_shift; |
|
31 | + |
|
32 | + /** Mask scaling coefficient. For example, 2.0 means double size. */ |
|
33 | + public float $scale; |
|
34 | + |
|
35 | + |
|
36 | + public function __construct(stdClass $update) { |
|
37 | + parent::__construct($update, self::subs); |
|
38 | + } |
|
39 | 39 | } |
@@ -8,20 +8,20 @@ |
||
8 | 8 | * This object represents one shipping option. |
9 | 9 | */ |
10 | 10 | class shippingOption extends types { |
11 | - /** Keep all of properties which has sub properties */ |
|
12 | - private const subs = []; |
|
11 | + /** Keep all of properties which has sub properties */ |
|
12 | + private const subs = []; |
|
13 | 13 | |
14 | - /** Shipping option identifier */ |
|
15 | - public string $id; |
|
14 | + /** Shipping option identifier */ |
|
15 | + public string $id; |
|
16 | 16 | |
17 | - /** Option title */ |
|
18 | - public string $title; |
|
17 | + /** Option title */ |
|
18 | + public string $title; |
|
19 | 19 | |
20 | - /** List of price portions */ |
|
21 | - public array $prices; |
|
20 | + /** List of price portions */ |
|
21 | + public array $prices; |
|
22 | 22 | |
23 | 23 | |
24 | - public function __construct(stdClass $update) { |
|
25 | - parent::__construct($update, self::subs); |
|
26 | - } |
|
24 | + public function __construct(stdClass $update) { |
|
25 | + parent::__construct($update, self::subs); |
|
26 | + } |
|
27 | 27 | } |
@@ -8,20 +8,20 @@ |
||
8 | 8 | * Contains data sent from a Web App to the bot. |
9 | 9 | */ |
10 | 10 | class webAppData extends types { |
11 | - /** Keep all of properties which has sub properties */ |
|
12 | - private const subs = []; |
|
11 | + /** Keep all of properties which has sub properties */ |
|
12 | + private const subs = []; |
|
13 | 13 | |
14 | - /** The data. Be aware that a bad client can send arbitrary data in this field. */ |
|
15 | - public string $data; |
|
14 | + /** The data. Be aware that a bad client can send arbitrary data in this field. */ |
|
15 | + public string $data; |
|
16 | 16 | |
17 | - /** |
|
18 | - * Text of the web_app keyboard button, from which the Web App was opened. Be aware that a bad client can send |
|
19 | - * arbitrary data in this field. |
|
20 | - */ |
|
21 | - public string $button_text; |
|
17 | + /** |
|
18 | + * Text of the web_app keyboard button, from which the Web App was opened. Be aware that a bad client can send |
|
19 | + * arbitrary data in this field. |
|
20 | + */ |
|
21 | + public string $button_text; |
|
22 | 22 | |
23 | 23 | |
24 | - public function __construct(stdClass $update) { |
|
25 | - parent::__construct($update, self::subs); |
|
26 | - } |
|
24 | + public function __construct(stdClass $update) { |
|
25 | + parent::__construct($update, self::subs); |
|
26 | + } |
|
27 | 27 | } |
@@ -8,44 +8,44 @@ |
||
8 | 8 | * Contains information about the current status of a webhook. |
9 | 9 | */ |
10 | 10 | class webhookInfo extends types { |
11 | - /** Keep all of properties which has sub properties */ |
|
12 | - private const subs = []; |
|
11 | + /** Keep all of properties which has sub properties */ |
|
12 | + private const subs = []; |
|
13 | 13 | |
14 | - /** Webhook URL, may be empty if webhook is not set up */ |
|
15 | - public string $url; |
|
14 | + /** Webhook URL, may be empty if webhook is not set up */ |
|
15 | + public string $url; |
|
16 | 16 | |
17 | - /** True, if a custom certificate was provided for webhook certificate checks */ |
|
18 | - public bool $has_custom_certificate; |
|
17 | + /** True, if a custom certificate was provided for webhook certificate checks */ |
|
18 | + public bool $has_custom_certificate; |
|
19 | 19 | |
20 | - /** Number of updates awaiting delivery */ |
|
21 | - public int $pending_update_count; |
|
20 | + /** Number of updates awaiting delivery */ |
|
21 | + public int $pending_update_count; |
|
22 | 22 | |
23 | - /** Optional. Currently used webhook IP address */ |
|
24 | - public string $ip_address; |
|
23 | + /** Optional. Currently used webhook IP address */ |
|
24 | + public string $ip_address; |
|
25 | 25 | |
26 | - /** Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook */ |
|
27 | - public int $last_error_date; |
|
26 | + /** Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook */ |
|
27 | + public int $last_error_date; |
|
28 | 28 | |
29 | - /** |
|
30 | - * Optional. Error message in human-readable format for the most recent error that happened when trying to |
|
31 | - * deliver an update via webhook |
|
32 | - */ |
|
33 | - public string $last_error_message; |
|
29 | + /** |
|
30 | + * Optional. Error message in human-readable format for the most recent error that happened when trying to |
|
31 | + * deliver an update via webhook |
|
32 | + */ |
|
33 | + public string $last_error_message; |
|
34 | 34 | |
35 | - /** |
|
36 | - * Optional. Unix time of the most recent error that happened when trying to synchronize available updates with |
|
37 | - * Telegram datacenters |
|
38 | - */ |
|
39 | - public int $last_synchronization_error_date; |
|
35 | + /** |
|
36 | + * Optional. Unix time of the most recent error that happened when trying to synchronize available updates with |
|
37 | + * Telegram datacenters |
|
38 | + */ |
|
39 | + public int $last_synchronization_error_date; |
|
40 | 40 | |
41 | - /** Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery */ |
|
42 | - public int $max_connections; |
|
41 | + /** Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery */ |
|
42 | + public int $max_connections; |
|
43 | 43 | |
44 | - /** Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member */ |
|
45 | - public array $allowed_updates; |
|
44 | + /** Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member */ |
|
45 | + public array $allowed_updates; |
|
46 | 46 | |
47 | 47 | |
48 | - public function __construct(stdClass $update) { |
|
49 | - parent::__construct($update, self::subs); |
|
50 | - } |
|
48 | + public function __construct(stdClass $update) { |
|
49 | + parent::__construct($update, self::subs); |
|
50 | + } |
|
51 | 51 | } |
@@ -8,14 +8,14 @@ |
||
8 | 8 | * This object represents a service message about new members invited to a video chat. |
9 | 9 | */ |
10 | 10 | class videoChatParticipantsInvited extends types { |
11 | - /** Keep all of properties which has sub properties */ |
|
12 | - private const subs = []; |
|
11 | + /** Keep all of properties which has sub properties */ |
|
12 | + private const subs = []; |
|
13 | 13 | |
14 | - /** New members that were invited to the video chat */ |
|
15 | - public array $users; |
|
14 | + /** New members that were invited to the video chat */ |
|
15 | + public array $users; |
|
16 | 16 | |
17 | 17 | |
18 | - public function __construct(stdClass $update) { |
|
19 | - parent::__construct($update, self::subs); |
|
20 | - } |
|
18 | + public function __construct(stdClass $update) { |
|
19 | + parent::__construct($update, self::subs); |
|
20 | + } |
|
21 | 21 | } |