@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | private static $handler; |
| 11 | 11 | |
| 12 | 12 | |
| 13 | - public static function init (int $log_size = 10) { |
|
| 13 | + public static function init(int $log_size = 10) { |
|
| 14 | 14 | self::$log_size = $log_size; |
| 15 | 15 | if (file_exists('BPT.log') && !(filesize('BPT.log') > self::$log_size * 1024 * 1024)) { |
| 16 | 16 | $mode = 'a'; |
@@ -24,13 +24,13 @@ discard block |
||
| 24 | 24 | self::$handler = fopen('BPT.log', $mode); |
| 25 | 25 | |
| 26 | 26 | if ($write) { |
| 27 | - fwrite(self::$handler,"♥♥♥♥♥♥♥♥♥♥♥♥♥♥ BPT Library ♥♥♥♥♥♥♥♥♥♥♥♥♥♥\nTnx for using our library\nSome information about us :\nAuthor : @Im_Miaad\nHelper : @A_LiReza_ME\nChannel : @BPT_CH\nOur Website : https://bptlib.ir\n\nIf you have any problem with our library\nContact to our supports\n♥♥♥♥♥♥♥♥♥♥♥♥♥♥ BPT Library ♥♥♥♥♥♥♥♥♥♥♥♥♥♥\nINFO : BPT Library LOG STARTED ...\nwarning : this file automatically deleted when its size reached log_size setting, do not delete it manually\n\n"); |
|
| 27 | + fwrite(self::$handler, "♥♥♥♥♥♥♥♥♥♥♥♥♥♥ BPT Library ♥♥♥♥♥♥♥♥♥♥♥♥♥♥\nTnx for using our library\nSome information about us :\nAuthor : @Im_Miaad\nHelper : @A_LiReza_ME\nChannel : @BPT_CH\nOur Website : https://bptlib.ir\n\nIf you have any problem with our library\nContact to our supports\n♥♥♥♥♥♥♥♥♥♥♥♥♥♥ BPT Library ♥♥♥♥♥♥♥♥♥♥♥♥♥♥\nINFO : BPT Library LOG STARTED ...\nwarning : this file automatically deleted when its size reached log_size setting, do not delete it manually\n\n"); |
|
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public static function write(string $data, string $type = loggerTypes::NONE) { |
| 32 | 32 | if (!is_null(self::$handler)) { |
| 33 | - $text = date('Y/m/d H:i:s') . ( $type === loggerTypes::NONE ? " : $data\n\n" : " : ⤵\n$type : $data\n\n" ); |
|
| 33 | + $text = date('Y/m/d H:i:s').($type === loggerTypes::NONE ? " : $data\n\n" : " : ⤵\n$type : $data\n\n"); |
|
| 34 | 34 | fwrite(self::$handler, $text); |
| 35 | 35 | } |
| 36 | 36 | } |
@@ -15,8 +15,7 @@ |
||
| 15 | 15 | if (file_exists('BPT.log') && !(filesize('BPT.log') > self::$log_size * 1024 * 1024)) { |
| 16 | 16 | $mode = 'a'; |
| 17 | 17 | $write = false; |
| 18 | - } |
|
| 19 | - else { |
|
| 18 | + } else { |
|
| 20 | 19 | $mode = 'w'; |
| 21 | 20 | $write = true; |
| 22 | 21 | } |
@@ -7,4 +7,4 @@ |
||
| 7 | 7 | /** |
| 8 | 8 | * Exceptions created by BPT and subclasses |
| 9 | 9 | */ |
| 10 | -class bptException extends Exception{} |
|
| 11 | 10 | \ No newline at end of file |
| 11 | +class bptException extends Exception {} |
|
| 12 | 12 | \ No newline at end of file |
@@ -4,4 +4,4 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Exception; |
| 6 | 6 | |
| 7 | -class telegramException extends Exception{} |
|
| 8 | 7 | \ No newline at end of file |
| 8 | +class telegramException extends Exception {} |
|
| 9 | 9 | \ No newline at end of file |
@@ -236,13 +236,13 @@ discard block |
||
| 236 | 236 | * @method gameHighScore[]|responseError getGameHighScores (int|null|array $user_id = null, int|null $chat_id = null, int|null $message_id = null, string|null $inline_message_id = null, string|null $token = null, bool|null $return_array = null, bool|null $forgot = null, bool|null $answer = null) Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects. |
| 237 | 237 | * @method gameHighScore[]|responseError getGameHigh (int|null|array $user_id = null, int|null $chat_id = null, int|null $message_id = null, string|null $inline_message_id = null, string|null $token = null, bool|null $return_array = null, bool|null $forgot = null, bool|null $answer = null) Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects. |
| 238 | 238 | */ |
| 239 | -class BPT extends telegram{ |
|
| 239 | +class BPT extends telegram { |
|
| 240 | 240 | public static update $update; |
| 241 | 241 | |
| 242 | 242 | public static BPT $handler; |
| 243 | 243 | |
| 244 | 244 | |
| 245 | - public function __construct (array|stdClass $settings) { |
|
| 245 | + public function __construct(array | stdClass $settings) { |
|
| 246 | 246 | static::$handler = &$this; |
| 247 | 247 | settings::init($settings); |
| 248 | 248 | } |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | settings::done(); |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | - public static function exit (string|null $message = null) { |
|
| 254 | + public static function exit (string | null $message = null) { |
|
| 255 | 255 | die($message ?? "<div style='width:98vw;height:98vh;display:flex;justify-content:center;align-items:center;font-size:25vw'>BPT</div>"); |
| 256 | 256 | } |
| 257 | 257 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | public string $description; |
| 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 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | /** Keep all of properties which has sub properties */ |
| 12 | 12 | private const subs = []; |
| 13 | 13 | |
| 14 | - public function __construct(stdClass|null $object = null) { |
|
| 14 | + public function __construct(stdClass | null $object = null) { |
|
| 15 | 15 | if ($object != null) { |
| 16 | 16 | parent::__construct($object, self::subs); |
| 17 | 17 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | public int $file_date; |
| 29 | 29 | |
| 30 | 30 | |
| 31 | - public function __construct(stdClass|null $object = null) { |
|
| 31 | + public function __construct(stdClass | null $object = null) { |
|
| 32 | 32 | if ($object != null) { |
| 33 | 33 | parent::__construct($object, self::subs); |
| 34 | 34 | } |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | public photoSize $thumb; |
| 47 | 47 | |
| 48 | 48 | |
| 49 | - public function __construct(stdClass|null $object = null) { |
|
| 49 | + public function __construct(stdClass | null $object = null) { |
|
| 50 | 50 | if ($object != null) { |
| 51 | 51 | parent::__construct($object, self::subs); |
| 52 | 52 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | public chatInviteLink $invite_link; |
| 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 | } |