@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $this->$key[$sub_key][] = new ($subs['array']['array'][$key]) ($sub2_value); |
27 | 27 | } |
28 | 28 | } |
29 | - elseif(isset($subs['array'][$key])){ |
|
29 | + elseif (isset($subs['array'][$key])) { |
|
30 | 30 | $this->$key[] = new ($subs['array'][$key]) ($sub_value); |
31 | 31 | } |
32 | 32 | else { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | } |
35 | 35 | } |
36 | 36 | } |
37 | - else{ |
|
37 | + else { |
|
38 | 38 | $this->$key = $value; |
39 | 39 | if (ucfirst($key) === basename(get_class($this)).'_id') { |
40 | 40 | $this->{'id'} = $value; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | public function __call(string $name, array $arguments) { |
49 | 49 | $name = strtolower($name); |
50 | 50 | if (str_starts_with($name, 'set')) { |
51 | - $name = substr($name,3); |
|
51 | + $name = substr($name, 3); |
|
52 | 52 | if (isset($arguments[0])) { |
53 | 53 | $this->$name = $arguments[0]; |
54 | 54 | } |
@@ -17,24 +17,20 @@ discard block |
||
17 | 17 | foreach ($object as $key=>$value) { |
18 | 18 | if (isset($subs[$key])) { |
19 | 19 | $this->$key = new ($subs[$key]) ($value); |
20 | - } |
|
21 | - else { |
|
20 | + } else { |
|
22 | 21 | if (is_array($value) && isset($subs['array'])) { |
23 | 22 | foreach ($value as $sub_key=>$sub_value) { |
24 | 23 | if (is_array($sub_value) && isset($subs['array']['array'])) { |
25 | 24 | foreach ($sub_value as $sub2_value) { |
26 | 25 | $this->$key[$sub_key][] = new ($subs['array']['array'][$key]) ($sub2_value); |
27 | 26 | } |
28 | - } |
|
29 | - elseif(isset($subs['array'][$key])){ |
|
27 | + } elseif(isset($subs['array'][$key])){ |
|
30 | 28 | $this->$key[] = new ($subs['array'][$key]) ($sub_value); |
31 | - } |
|
32 | - else { |
|
29 | + } else { |
|
33 | 30 | $this->$key[] = $sub_value; |
34 | 31 | } |
35 | 32 | } |
36 | - } |
|
37 | - else{ |
|
33 | + } else{ |
|
38 | 34 | $this->$key = $value; |
39 | 35 | if (ucfirst($key) === basename(get_class($this)).'_id') { |
40 | 36 | $this->{'id'} = $value; |
@@ -51,8 +47,7 @@ discard block |
||
51 | 47 | $name = substr($name,3); |
52 | 48 | if (isset($arguments[0])) { |
53 | 49 | $this->$name = $arguments[0]; |
54 | - } |
|
55 | - elseif (isset($arguments['value'])) { |
|
50 | + } elseif (isset($arguments['value'])) { |
|
56 | 51 | $this->$name = $arguments['value']; |
57 | 52 | } |
58 | 53 | } |
@@ -67,7 +67,7 @@ |
||
67 | 67 | public bool $can_manage_topics; |
68 | 68 | |
69 | 69 | |
70 | - public function __construct(stdClass|null $object = null) { |
|
70 | + public function __construct(stdClass | null $object = null) { |
|
71 | 71 | if ($object != null) { |
72 | 72 | parent::__construct($object, self::subs); |
73 | 73 | } |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | public int $duration; |
29 | 29 | |
30 | 30 | /** Optional. Video thumbnail */ |
31 | - public null|photoSize $thumb = null; |
|
31 | + public null | photoSize $thumb = null; |
|
32 | 32 | |
33 | 33 | /** Optional. File size in bytes */ |
34 | - public null|int $file_size = null; |
|
34 | + public null | int $file_size = null; |
|
35 | 35 | |
36 | 36 | |
37 | - public function __construct(stdClass|null $object = null) { |
|
37 | + public function __construct(stdClass | null $object = null) { |
|
38 | 38 | if ($object != null) { |
39 | 39 | parent::__construct($object, self::subs); |
40 | 40 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @return bool|string string will be returned when destination doesn't set |
57 | 57 | */ |
58 | - public function download(string|null $destination = null): bool|string { |
|
59 | - return telegram::downloadFile($destination ?? 'unknown.mp4',$this->file_id); |
|
58 | + public function download(string | null $destination = null): bool | string { |
|
59 | + return telegram::downloadFile($destination ?? 'unknown.mp4', $this->file_id); |
|
60 | 60 | } |
61 | 61 | } |
@@ -18,10 +18,10 @@ |
||
18 | 18 | public int $icon_color; |
19 | 19 | |
20 | 20 | /** Optional. Unique identifier of the custom emoji shown as the topic icon */ |
21 | - public null|string $icon_custom_emoji_id = null; |
|
21 | + public null | string $icon_custom_emoji_id = null; |
|
22 | 22 | |
23 | 23 | |
24 | - public function __construct(stdClass|null $object = null) { |
|
24 | + public function __construct(stdClass | null $object = null) { |
|
25 | 25 | if ($object != null) { |
26 | 26 | parent::__construct($object, self::subs); |
27 | 27 | } |
@@ -25,13 +25,13 @@ |
||
25 | 25 | public int $date; |
26 | 26 | |
27 | 27 | /** Optional. Bio of the user. */ |
28 | - public null|string $bio = null; |
|
28 | + public null | string $bio = null; |
|
29 | 29 | |
30 | 30 | /** Optional. Chat invite link that was used by the user to send the join request */ |
31 | - public null|chatInviteLink $invite_link = null; |
|
31 | + public null | chatInviteLink $invite_link = null; |
|
32 | 32 | |
33 | 33 | |
34 | - public function __construct(stdClass|null $object = null) { |
|
34 | + public function __construct(stdClass | null $object = null) { |
|
35 | 35 | if ($object != null) { |
36 | 36 | parent::__construct($object, self::subs); |
37 | 37 | } |
@@ -31,23 +31,23 @@ discard block |
||
31 | 31 | public int $duration; |
32 | 32 | |
33 | 33 | /** Optional. Animation thumbnail as defined by sender */ |
34 | - public null|photoSize $thumb = null; |
|
34 | + public null | photoSize $thumb = null; |
|
35 | 35 | |
36 | 36 | /** Optional. Original animation filename as defined by sender */ |
37 | - public null|string $file_name = null; |
|
37 | + public null | string $file_name = null; |
|
38 | 38 | |
39 | 39 | /** Optional. MIME type of the file as defined by sender */ |
40 | - public null|string $mime_type = null; |
|
40 | + public null | string $mime_type = null; |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have |
44 | 44 | * difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit |
45 | 45 | * integer or double-precision float type are safe for storing this value. |
46 | 46 | */ |
47 | - public null|int $file_size = null; |
|
47 | + public null | int $file_size = null; |
|
48 | 48 | |
49 | 49 | |
50 | - public function __construct(stdClass|null $object = null) { |
|
50 | + public function __construct(stdClass | null $object = null) { |
|
51 | 51 | if ($object != null) { |
52 | 52 | parent::__construct($object, self::subs); |
53 | 53 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @return bool|string string will be returned when destination doesn't set |
70 | 70 | */ |
71 | - public function download(string|null $destination = null): bool|string { |
|
72 | - return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.gif',$this->file_id); |
|
71 | + public function download(string | null $destination = null): bool | string { |
|
72 | + return telegram::downloadFile($destination ?? $this->file_name ?? 'unknown.gif', $this->file_id); |
|
73 | 73 | } |
74 | 74 | } |
@@ -32,19 +32,19 @@ |
||
32 | 32 | * edited to include current high scores for the game when the bot calls setGameScore, or manually edited using |
33 | 33 | * editMessageText. 0-4096 characters. |
34 | 34 | */ |
35 | - public null|string $text = null; |
|
35 | + public null | string $text = null; |
|
36 | 36 | |
37 | 37 | /** |
38 | 38 | * Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc. |
39 | 39 | * @var messageEntity[] |
40 | 40 | */ |
41 | - public null|array $text_entities = null; |
|
41 | + public null | array $text_entities = null; |
|
42 | 42 | |
43 | 43 | /** Optional. Animation that will be displayed in the game message in chats. Upload via BotFather */ |
44 | - public null|animation $animation = null; |
|
44 | + public null | animation $animation = null; |
|
45 | 45 | |
46 | 46 | |
47 | - public function __construct(stdClass|null $object = null) { |
|
47 | + public function __construct(stdClass | null $object = null) { |
|
48 | 48 | if ($object != null) { |
49 | 49 | parent::__construct($object, self::subs); |
50 | 50 | } |
@@ -18,78 +18,78 @@ |
||
18 | 18 | public user $user; |
19 | 19 | |
20 | 20 | /** `creator` and `administrator` only. True, if the user's presence in the chat is hidden */ |
21 | - public null|bool $is_anonymous = null; |
|
21 | + public null | bool $is_anonymous = null; |
|
22 | 22 | |
23 | 23 | /** `creator` and `administrator` only. Custom title for this user */ |
24 | - public null|string $custom_title = null; |
|
24 | + public null | string $custom_title = null; |
|
25 | 25 | |
26 | 26 | /** `administrator` only. True, if the bot is allowed to edit administrator privileges of that user */ |
27 | - public null|bool $can_be_edited = null; |
|
27 | + public null | bool $can_be_edited = null; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * `administrator` only. True, if the administrator can access the chat event log, chat statistics, message statistics in |
31 | 31 | * channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other |
32 | 32 | * administrator privilege |
33 | 33 | */ |
34 | - public null|bool $can_manage_chat = null; |
|
34 | + public null | bool $can_manage_chat = null; |
|
35 | 35 | |
36 | 36 | /** `administrator` only. True, if the administrator can delete messages of other users */ |
37 | - public null|bool $can_delete_messages = null; |
|
37 | + public null | bool $can_delete_messages = null; |
|
38 | 38 | |
39 | 39 | /** `administrator` only. True, if the administrator can manage video chats */ |
40 | - public null|bool $can_manage_video_chats = null; |
|
40 | + public null | bool $can_manage_video_chats = null; |
|
41 | 41 | |
42 | 42 | /** `administrator` only. True, if the administrator can restrict, ban or unban chat members */ |
43 | - public null|bool $can_restrict_members = null; |
|
43 | + public null | bool $can_restrict_members = null; |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * `administrator` only. if the administrator can add new administrators with a subset of their own privileges or demote |
47 | 47 | * administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by |
48 | 48 | * the user) |
49 | 49 | */ |
50 | - public null|bool $can_promote_members = null; |
|
50 | + public null | bool $can_promote_members = null; |
|
51 | 51 | |
52 | 52 | /** `administrator` and `restricted` only. True, if the user is allowed to change the chat title, photo and other settings */ |
53 | - public null|bool $can_change_info = null; |
|
53 | + public null | bool $can_change_info = null; |
|
54 | 54 | |
55 | 55 | /** `administrator` and `restricted` only. True, if the user is allowed to invite new users to the chat */ |
56 | - public null|bool $can_invite_users = null; |
|
56 | + public null | bool $can_invite_users = null; |
|
57 | 57 | |
58 | 58 | /** `administrator` only. Optional. True, if the administrator can post in the channel; channels only */ |
59 | - public null|bool $can_post_messages = null; |
|
59 | + public null | bool $can_post_messages = null; |
|
60 | 60 | |
61 | 61 | /** `administrator` only. Optional. True, if the administrator can edit messages of other users and can pin messages; channels only */ |
62 | - public null|bool $can_edit_messages = null; |
|
62 | + public null | bool $can_edit_messages = null; |
|
63 | 63 | |
64 | 64 | /** `administrator` and `restricted` only. Optional. True, if the user is allowed to pin messages; groups and supergroups only */ |
65 | - public null|bool $can_pin_messages = null; |
|
65 | + public null | bool $can_pin_messages = null; |
|
66 | 66 | /** |
67 | 67 | * `administrator` : Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only |
68 | 68 | * |
69 | 69 | * `restricted` : True, if the user is allowed to create forum topics |
70 | 70 | */ |
71 | - public null|bool $can_manage_topics = null; |
|
71 | + public null | bool $can_manage_topics = null; |
|
72 | 72 | |
73 | 73 | /** `restricted` only. True, if the user is a member of the chat at the moment of the request */ |
74 | - public null|bool $is_member = null; |
|
74 | + public null | bool $is_member = null; |
|
75 | 75 | |
76 | 76 | /** `restricted` only. True, if the user is allowed to send text messages, contacts, locations and venues */ |
77 | - public null|bool $can_send_messages = null; |
|
77 | + public null | bool $can_send_messages = null; |
|
78 | 78 | |
79 | 79 | /** `restricted` only. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes */ |
80 | - public null|bool $can_send_media_messages = null; |
|
80 | + public null | bool $can_send_media_messages = null; |
|
81 | 81 | |
82 | 82 | /** `restricted` only. True, if the user is allowed to send polls */ |
83 | - public null|bool $can_send_polls = null; |
|
83 | + public null | bool $can_send_polls = null; |
|
84 | 84 | |
85 | 85 | /** `restricted` only. True, if the user is allowed to send animations, games, stickers and use inline bots */ |
86 | - public null|bool $can_send_other_messages = null; |
|
86 | + public null | bool $can_send_other_messages = null; |
|
87 | 87 | |
88 | 88 | /** `restricted` only. True, if the user is allowed to add web page previews to their messages */ |
89 | - public null|bool $can_add_web_page_previews = null; |
|
89 | + public null | bool $can_add_web_page_previews = null; |
|
90 | 90 | |
91 | 91 | /** `kicked` and `restricted` only. Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever */ |
92 | - public null|int $until_date = null; |
|
92 | + public null | int $until_date = null; |
|
93 | 93 | |
94 | 94 | |
95 | 95 | public function __construct(stdClass $object) { |
@@ -15,40 +15,40 @@ |
||
15 | 15 | public string $url = ''; |
16 | 16 | |
17 | 17 | /** True, if a custom certificate was provided for webhook certificate checks */ |
18 | - public null|bool $has_custom_certificate = null; |
|
18 | + public null | bool $has_custom_certificate = null; |
|
19 | 19 | |
20 | 20 | /** Number of updates awaiting delivery */ |
21 | 21 | public int $pending_update_count; |
22 | 22 | |
23 | 23 | /** Optional. Currently used webhook IP address */ |
24 | - public null|string $ip_address = null; |
|
24 | + public null | string $ip_address = null; |
|
25 | 25 | |
26 | 26 | /** Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook */ |
27 | - public null|int $last_error_date = null; |
|
27 | + public null | int $last_error_date = null; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Optional. Error message in human-readable format for the most recent error that happened when trying to |
31 | 31 | * deliver an update via webhook |
32 | 32 | */ |
33 | - public null|string $last_error_message = null; |
|
33 | + public null | string $last_error_message = null; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * Optional. Unix time of the most recent error that happened when trying to synchronize available updates with |
37 | 37 | * Telegram datacenters |
38 | 38 | */ |
39 | - public null|int $last_synchronization_error_date = null; |
|
39 | + public null | int $last_synchronization_error_date = null; |
|
40 | 40 | |
41 | 41 | /** Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery */ |
42 | - public null|int $max_connections = null; |
|
42 | + public null | int $max_connections = null; |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member |
46 | 46 | * @var string[] |
47 | 47 | */ |
48 | - public null|array $allowed_updates = null; |
|
48 | + public null | array $allowed_updates = null; |
|
49 | 49 | |
50 | 50 | |
51 | - public function __construct(stdClass|null $object = null) { |
|
51 | + public function __construct(stdClass | null $object = null) { |
|
52 | 52 | if ($object != null) { |
53 | 53 | parent::__construct($object, self::subs); |
54 | 54 | } |