@@ -12,19 +12,19 @@ |
||
12 | 12 | private const subs = ['shipping_address' => 'BPT\types\shippingAddress']; |
13 | 13 | |
14 | 14 | /** Optional. User name */ |
15 | - public null|string $name = null; |
|
15 | + public null | string $name = null; |
|
16 | 16 | |
17 | 17 | /** Optional. User's phone number */ |
18 | - public null|string $phone_number = null; |
|
18 | + public null | string $phone_number = null; |
|
19 | 19 | |
20 | 20 | /** Optional. User email */ |
21 | - public null|string $email = null; |
|
21 | + public null | string $email = null; |
|
22 | 22 | |
23 | 23 | /** Optional. User shipping address */ |
24 | - public null|shippingAddress $shipping_address = null; |
|
24 | + public null | shippingAddress $shipping_address = null; |
|
25 | 25 | |
26 | 26 | |
27 | - public function __construct(stdClass|null $object = null) { |
|
27 | + public function __construct(stdClass | null $object = null) { |
|
28 | 28 | if ($object != null) { |
29 | 29 | parent::__construct($object, self::subs); |
30 | 30 | } |
@@ -21,22 +21,22 @@ |
||
21 | 21 | public string $address; |
22 | 22 | |
23 | 23 | /** Optional. Foursquare identifier of the venue */ |
24 | - public null|string $foursquare_id = null; |
|
24 | + public null | string $foursquare_id = null; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Optional. Foursquare type of the venue. (For example, “arts_entertainment/default”, |
28 | 28 | * “arts_entertainment/aquarium” or “food/icecream”.) |
29 | 29 | */ |
30 | - public null|string $foursquare_type = null; |
|
30 | + public null | string $foursquare_type = null; |
|
31 | 31 | |
32 | 32 | /** Optional. Google Places identifier of the venue */ |
33 | - public null|string $google_place_id = null; |
|
33 | + public null | string $google_place_id = null; |
|
34 | 34 | |
35 | 35 | /** Optional. Google Places type of the venue. (See supported types.) */ |
36 | - public null|string $google_place_type = null; |
|
36 | + public null | string $google_place_type = null; |
|
37 | 37 | |
38 | 38 | |
39 | - public function __construct(stdClass|null $object = null) { |
|
39 | + public function __construct(stdClass | null $object = null) { |
|
40 | 40 | if ($object != null) { |
41 | 41 | parent::__construct($object, self::subs); |
42 | 42 | } |
@@ -25,10 +25,10 @@ discard block |
||
25 | 25 | public string $invoice_payload; |
26 | 26 | |
27 | 27 | /** Optional. Identifier of the shipping option chosen by the user */ |
28 | - public null|string $shipping_option_id = null; |
|
28 | + public null | string $shipping_option_id = null; |
|
29 | 29 | |
30 | 30 | /** Optional. Order information provided by the user */ |
31 | - public null|orderInfo $order_info = null; |
|
31 | + public null | orderInfo $order_info = null; |
|
32 | 32 | |
33 | 33 | /** Telegram payment identifier */ |
34 | 34 | public string $telegram_payment_charge_id; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | public string $provider_payment_charge_id; |
38 | 38 | |
39 | 39 | |
40 | - public function __construct(stdClass|null $object = null) { |
|
40 | + public function __construct(stdClass | null $object = null) { |
|
41 | 41 | if ($object != null) { |
42 | 42 | parent::__construct($object, self::subs); |
43 | 43 | } |
@@ -18,19 +18,19 @@ |
||
18 | 18 | public user $from; |
19 | 19 | |
20 | 20 | /** Optional. Sender location, only for bots that require user location */ |
21 | - public null|location $location = null; |
|
21 | + public null | location $location = null; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the |
25 | 25 | * message. Will be also received in callback queries and can be used to edit the message. |
26 | 26 | */ |
27 | - public null|string $inline_message_id = null; |
|
27 | + public null | string $inline_message_id = null; |
|
28 | 28 | |
29 | 29 | /** The query that was used to obtain the result */ |
30 | 30 | public string $query; |
31 | 31 | |
32 | 32 | |
33 | - public function __construct(stdClass|null $object = null) { |
|
33 | + public function __construct(stdClass | null $object = null) { |
|
34 | 34 | if ($object != null) { |
35 | 35 | parent::__construct($object, self::subs); |
36 | 36 | } |
@@ -17,16 +17,16 @@ |
||
17 | 17 | * But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for |
18 | 18 | * storing this identifier. |
19 | 19 | */ |
20 | - public null|int $migrate_to_chat_id = null; |
|
20 | + public null | int $migrate_to_chat_id = null; |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be |
24 | 24 | * repeated |
25 | 25 | */ |
26 | - public null|int $retry_after = null; |
|
26 | + public null | int $retry_after = null; |
|
27 | 27 | |
28 | 28 | |
29 | - public function __construct(stdClass|null $object = null) { |
|
29 | + public function __construct(stdClass | null $object = null) { |
|
30 | 30 | if ($object != null) { |
31 | 31 | parent::__construct($object, self::subs); |
32 | 32 | } |
@@ -15,10 +15,10 @@ |
||
15 | 15 | * Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the |
16 | 16 | * message. |
17 | 17 | */ |
18 | - public null|string $inline_message_id = null; |
|
18 | + public null | string $inline_message_id = null; |
|
19 | 19 | |
20 | 20 | |
21 | - public function __construct(stdClass|null $object = null) { |
|
21 | + public function __construct(stdClass | null $object = null) { |
|
22 | 22 | if ($object != null) { |
23 | 23 | parent::__construct($object, self::subs); |
24 | 24 | } |
@@ -78,11 +78,9 @@ |
||
78 | 78 | $value = 'bots_files/' . $value . '/'; |
79 | 79 | } |
80 | 80 | self::$$setting = $value; |
81 | - } |
|
82 | - catch (TypeError) { |
|
81 | + } catch (TypeError) { |
|
83 | 82 | logger::write("$setting setting has wrong type , its set to default value", loggerTypes::WARNING); |
84 | - } |
|
85 | - catch (Error) { |
|
83 | + } catch (Error) { |
|
86 | 84 | logger::write("$setting setting is not one of library settings", loggerTypes::WARNING); |
87 | 85 | } |
88 | 86 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | public static int $log_size = 10; |
31 | 31 | |
32 | - public static string|CURLFile|null $certificate = null; |
|
32 | + public static string | CURLFile | null $certificate = null; |
|
33 | 33 | |
34 | 34 | public static bool $handler = true; |
35 | 35 | |
@@ -65,20 +65,20 @@ discard block |
||
65 | 65 | |
66 | 66 | public static int $base_timeout = 1000; |
67 | 67 | |
68 | - public static string|null $receiver = receiver::WEBHOOK; |
|
68 | + public static string | null $receiver = receiver::WEBHOOK; |
|
69 | 69 | |
70 | 70 | public static array $allowed_updates = ['message', 'edited_channel_post', 'callback_query', 'inline_query']; |
71 | 71 | |
72 | 72 | public static bool $use_types_classes = true; |
73 | 73 | |
74 | - public static array|null $db = null; |
|
74 | + public static array | null $db = null; |
|
75 | 75 | |
76 | - public static array|null $pay = null; |
|
76 | + public static array | null $pay = null; |
|
77 | 77 | |
78 | 78 | /** |
79 | 79 | * @internal Only for BPT self usage , Don't use it in your source! |
80 | 80 | */ |
81 | - public static function init (array|easySettings $settings): void { |
|
81 | + public static function init(array | easySettings $settings): void { |
|
82 | 82 | if (!is_array($settings)) { |
83 | 83 | $settings = $settings->getSettings(); |
84 | 84 | } |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | if (!is_dir(realpath('bots_files'))) { |
89 | 89 | mkdir('bots_files'); |
90 | 90 | } |
91 | - if (!is_dir(realpath('bots_files/' . $value))) { |
|
92 | - mkdir('bots_files/' . $value); |
|
91 | + if (!is_dir(realpath('bots_files/'.$value))) { |
|
92 | + mkdir('bots_files/'.$value); |
|
93 | 93 | } |
94 | - $value = 'bots_files/' . $value . '/'; |
|
94 | + $value = 'bots_files/'.$value.'/'; |
|
95 | 95 | } |
96 | 96 | self::$$setting = $value; |
97 | 97 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | /** |
135 | 135 | * @internal Only for BPT self usage , Don't use it in your source! |
136 | 136 | */ |
137 | - public static function done (): void { |
|
137 | + public static function done(): void { |
|
138 | 138 | if (!self::$logger) { |
139 | 139 | return; |
140 | 140 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | logger::write("BPT Done in $estimated ms , $status_message", $type); |
151 | 151 | } |
152 | 152 | |
153 | - private static function security (): void { |
|
153 | + private static function security(): void { |
|
154 | 154 | if (!self::$security) { |
155 | 155 | return; |
156 | 156 | } |
@@ -166,13 +166,13 @@ discard block |
||
166 | 166 | ini_set('error_reporting', 0); |
167 | 167 | } |
168 | 168 | |
169 | - private static function secureFolder (): void { |
|
169 | + private static function secureFolder(): void { |
|
170 | 170 | if (!self::$secure_folder) { |
171 | 171 | return; |
172 | 172 | } |
173 | 173 | $address = explode('/', $_SERVER['REQUEST_URI']); |
174 | 174 | unset($address[count($address) - 1]); |
175 | - $address = implode('/', $address) . '/BPT.php'; |
|
175 | + $address = implode('/', $address).'/BPT.php'; |
|
176 | 176 | $text = "ErrorDocument 404 $address\nErrorDocument 403 $address\n Options -Indexes\n Order Deny,Allow\nDeny from all\nAllow from 127.0.0.1\n<Files *.php>\n Order Allow,Deny\n Allow from all\n</Files>"; |
177 | 177 | $htaccess = realpath('.htaccess'); |
178 | 178 | if (!file_exists($htaccess) || filesize($htaccess) != strlen($text)) { |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | } |
181 | 181 | } |
182 | 182 | |
183 | - private static function getUpdates (): void { |
|
183 | + private static function getUpdates(): void { |
|
184 | 184 | if (!self::$handler) { |
185 | 185 | logger::write('You can\'t use getUpdates receiver when handler is off , use webhook or use handler', loggerTypes::ERROR); |
186 | 186 | throw new bptException('GETUPDATE_NEED_HANDLER'); |
@@ -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 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | /** |
18 | 18 | * @internal Only for BPT self usage , Don't use it in your source! |
19 | 19 | */ |
20 | - public static function init (): void { |
|
20 | + public static function init(): void { |
|
21 | 21 | if (!isset(settings::$db['type'])) { |
22 | 22 | settings::$db['type'] = dbTypes::JSON; |
23 | 23 | } |