Passed
Push — main ( bfb9d3...b0527a )
by Miaad
01:30
created
settings.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
     public static int $log_size = 10;
23 23
 
24
-    public static string|CURLFile|null $certificate = null;
24
+    public static string | CURLFile | null $certificate = null;
25 25
 
26 26
     public static bool $handler = true;
27 27
 
@@ -51,10 +51,10 @@  discard block
 block discarded – undo
51 51
 
52 52
     public static array $allowed_updates = ['message', 'edited_channel_post', 'callback_query', 'inline_query'];
53 53
 
54
-    public static array|mysqli|null $db = ['type' => 'json', 'file_name' => 'BPT-DB.json'];
54
+    public static array | mysqli | null $db = ['type' => 'json', 'file_name' => 'BPT-DB.json'];
55 55
 
56 56
 
57
-    public static function init (array|stdClass $settings) {
57
+    public static function init(array | stdClass $settings) {
58 58
         $settings = (array) $settings;
59 59
 
60 60
         if (!(isset($settings['logger']) && $settings['logger'] == false)) {
@@ -62,14 +62,14 @@  discard block
 block discarded – undo
62 62
         }
63 63
 
64 64
         foreach ($settings as $setting => $value) {
65
-            try{
65
+            try {
66 66
                 self::$$setting = $value;
67 67
             }
68
-            catch (TypeError){
69
-                logger::write("$setting setting has wrong type , its set to default value",'warning');
68
+            catch (TypeError) {
69
+                logger::write("$setting setting has wrong type , its set to default value", 'warning');
70 70
             }
71
-            catch (Error){
72
-                logger::write("$setting setting is not one of library settings",'warning');
71
+            catch (Error) {
72
+                logger::write("$setting setting is not one of library settings", 'warning');
73 73
             }
74 74
         }
75 75
 
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
                 self::$receiver !== receiver::GETUPDATES ? self::webhook() : self::getUpdates();
82 82
             }
83 83
             else {
84
-                logger::write('token format is not right, check it and try again','error');
84
+                logger::write('token format is not right, check it and try again', 'error');
85 85
             }
86 86
         }
87 87
         else {
88
-            logger::write('You must specify token parameter in settings','error');
88
+            logger::write('You must specify token parameter in settings', 'error');
89 89
         }
90 90
     }
91 91
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         if (self::$secure_folder) {
109 109
             $address = explode('/', $_SERVER['REQUEST_URI']);
110 110
             unset($address[count($address) - 1]);
111
-            $address = implode('/', $address) . '/BPT.php';
111
+            $address = implode('/', $address).'/BPT.php';
112 112
             $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>";
113 113
             if (!file_exists('.htaccess') || filesize('.htaccess') != strlen($text)) {
114 114
                 file_put_contents('.htaccess', $text);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             getUpdates::init();
128 128
         }
129 129
         else {
130
-            logger::write('You can\'t use getUpdates receiver when handler is off , use webhook or use handler','error');
130
+            logger::write('You can\'t use getUpdates receiver when handler is off , use webhook or use handler', 'error');
131 131
         }
132 132
     }
133 133
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -64,11 +64,9 @@  discard block
 block discarded – undo
64 64
         foreach ($settings as $setting => $value) {
65 65
             try{
66 66
                 self::$$setting = $value;
67
-            }
68
-            catch (TypeError){
67
+            } catch (TypeError){
69 68
                 logger::write("$setting setting has wrong type , its set to default value",'warning');
70
-            }
71
-            catch (Error){
69
+            } catch (Error){
72 70
                 logger::write("$setting setting is not one of library settings",'warning');
73 71
             }
74 72
         }
@@ -79,12 +77,10 @@  discard block
 block discarded – undo
79 77
                 self::secureFolder();
80 78
                 self::db();
81 79
                 self::$receiver !== receiver::GETUPDATES ? self::webhook() : self::getUpdates();
82
-            }
83
-            else {
80
+            } else {
84 81
                 logger::write('token format is not right, check it and try again','error');
85 82
             }
86
-        }
87
-        else {
83
+        } else {
88 84
             logger::write('You must specify token parameter in settings','error');
89 85
         }
90 86
     }
@@ -125,8 +121,7 @@  discard block
 block discarded – undo
125 121
     private static function getUpdates() {
126 122
         if (self::$handler) {
127 123
             getUpdates::init();
128
-        }
129
-        else {
124
+        } else {
130 125
             logger::write('You can\'t use getUpdates receiver when handler is off , use webhook or use handler','error');
131 126
         }
132 127
     }
Please login to merge, or discard this patch.
receiver/getUpdates.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 namespace BPT\receiver;
4 4
 
5 5
 class getUpdates {
6
-    public static function init () {
6
+    public static function init() {
7 7
 
8 8
     }
9 9
 }
10 10
\ No newline at end of file
Please login to merge, or discard this patch.
constants/updateTypes.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -6,18 +6,18 @@
 block discarded – undo
6 6
  * Different type of updates
7 7
  */
8 8
 class updateTypes {
9
-	public const MESSAGE = 'message';
10
-	public const EDITED_MESSAGE = 'edited_message';
11
-	public const CHANNEL_POST = 'channel_post';
12
-	public const EDITED_CHANNEL_POST = 'edited_channel_post';
13
-	public const INLINE_QUERY = 'inline_query';
14
-	public const CHOSEN_INLINE_RESULT = 'chosen_inline_result';
15
-	public const CALLBACK_QUERY = 'callback_query';
16
-	public const SHIPPING_QUERY = 'shipping_query';
17
-	public const PRE_CHECKOUT_QUERY = 'pre_checkout_query';
18
-	public const POLL = 'poll';
19
-	public const POLL_ANSWER = 'poll_answer';
20
-	public const MY_CHAT_MEMBER = 'my_chat_member';
21
-	public const CHAT_MEMBER = 'chat_member';
22
-	public const CHAT_JOIN_REQUEST = 'chat_join_request';
9
+    public const MESSAGE = 'message';
10
+    public const EDITED_MESSAGE = 'edited_message';
11
+    public const CHANNEL_POST = 'channel_post';
12
+    public const EDITED_CHANNEL_POST = 'edited_channel_post';
13
+    public const INLINE_QUERY = 'inline_query';
14
+    public const CHOSEN_INLINE_RESULT = 'chosen_inline_result';
15
+    public const CALLBACK_QUERY = 'callback_query';
16
+    public const SHIPPING_QUERY = 'shipping_query';
17
+    public const PRE_CHECKOUT_QUERY = 'pre_checkout_query';
18
+    public const POLL = 'poll';
19
+    public const POLL_ANSWER = 'poll_answer';
20
+    public const MY_CHAT_MEMBER = 'my_chat_member';
21
+    public const CHAT_MEMBER = 'chat_member';
22
+    public const CHAT_JOIN_REQUEST = 'chat_join_request';
23 23
 }
Please login to merge, or discard this patch.
constants/chatActions.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -7,33 +7,33 @@
 block discarded – undo
7 7
  * set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its status)
8 8
  */
9 9
 class chatActions {
10
-	/** Sets chat status as Typing */
11
-	public const TYPING = 'typing';
10
+    /** Sets chat status as Typing */
11
+    public const TYPING = 'typing';
12 12
 
13
-	/** Sets chat status as Sending Photo */
14
-	public const UPLOAD_PHOTO = 'upload_photo';
13
+    /** Sets chat status as Sending Photo */
14
+    public const UPLOAD_PHOTO = 'upload_photo';
15 15
 
16
-	/** Sets chat status as Recording Video */
17
-	public const RECORD_VIDEO = 'record_video';
16
+    /** Sets chat status as Recording Video */
17
+    public const RECORD_VIDEO = 'record_video';
18 18
 
19
-	/** Sets chat status as Sending Video */
20
-	public const UPLOAD_VIDEO = 'upload_video';
19
+    /** Sets chat status as Sending Video */
20
+    public const UPLOAD_VIDEO = 'upload_video';
21 21
 
22
-	/** Sets chat status as Recording Audio */
23
-	public const RECORD_AUDIO = 'record_audio';
22
+    /** Sets chat status as Recording Audio */
23
+    public const RECORD_AUDIO = 'record_audio';
24 24
 
25
-	/** Sets chat status as Sending Audio */
26
-	public const UPLOAD_AUDIO = 'upload_audio';
25
+    /** Sets chat status as Sending Audio */
26
+    public const UPLOAD_AUDIO = 'upload_audio';
27 27
 
28
-	/** Sets chat status as Sending Document */
29
-	public const UPLOAD_DOCUMENT = 'upload_document';
28
+    /** Sets chat status as Sending Document */
29
+    public const UPLOAD_DOCUMENT = 'upload_document';
30 30
 
31
-	/** Sets chat status as Choosing Geo */
32
-	public const FIND_LOCATION = 'find_location';
31
+    /** Sets chat status as Choosing Geo */
32
+    public const FIND_LOCATION = 'find_location';
33 33
 
34
-	/** Sets chat status as Recording Video Note */
35
-	public const RECORD_VIDEO_NOTE = 'record_video_note';
34
+    /** Sets chat status as Recording Video Note */
35
+    public const RECORD_VIDEO_NOTE = 'record_video_note';
36 36
 
37
-	/** Sets chat status as Sending Video Note */
38
-	public const UPLOAD_VIDEO_NOTE = 'upload_video_note';
37
+    /** Sets chat status as Sending Video Note */
38
+    public const UPLOAD_VIDEO_NOTE = 'upload_video_note';
39 39
 }
Please login to merge, or discard this patch.
constants/pollType.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,6 +6,6 @@
 block discarded – undo
6 6
  * Different type of polls
7 7
  */
8 8
 class pollType {
9
-	public const REGULAR = 'regular';
10
-	public const QUIZ = 'quiz';
9
+    public const REGULAR = 'regular';
10
+    public const QUIZ = 'quiz';
11 11
 }
Please login to merge, or discard this patch.
constants/parseMode.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
  * Different types of parse modes
7 7
  */
8 8
 class parseMode {
9
-	public const MARKDOWNV2 = 'MarkdownV2';
10
-	public const MARKDOWN = 'Markdown';
11
-	public const HTML = 'HTML';
9
+    public const MARKDOWNV2 = 'MarkdownV2';
10
+    public const MARKDOWN = 'Markdown';
11
+    public const HTML = 'HTML';
12 12
 }
Please login to merge, or discard this patch.
constants/receiver.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,6 +6,6 @@
 block discarded – undo
6 6
  * Different types of update receiver
7 7
  */
8 8
 class receiver {
9
-	public const GETUPDATES = 'getupdates';
10
-	public const WEBHOOK = 'webhook';
9
+    public const GETUPDATES = 'getupdates';
10
+    public const WEBHOOK = 'webhook';
11 11
 }
Please login to merge, or discard this patch.
constants/messageEntityTypes.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -6,19 +6,19 @@
 block discarded – undo
6 6
  * types of message entity
7 7
  */
8 8
 class messageEntityTypes {
9
-	public const MENTION = 'mention';
10
-	public const HASHTAG = 'hashtag';
11
-	public const CASHTAG = 'cashtag';
12
-	public const BOT_COMMAND = 'bot_command';
13
-	public const URL = 'url';
14
-	public const EMAIL = 'email';
15
-	public const PHONE_NUMBER = 'phone_number';
16
-	public const BOLD = 'bold';
17
-	public const ITALIC = 'italic';
18
-	public const UNDERLINE = 'underline';
19
-	public const STRIKETHROUGH = 'strikethrough';
20
-	public const CODE = 'code';
21
-	public const PRE = 'pre';
22
-	public const TEXT_LINK = 'text_link';
23
-	public const TEXT_MENTION = 'text_mention';
9
+    public const MENTION = 'mention';
10
+    public const HASHTAG = 'hashtag';
11
+    public const CASHTAG = 'cashtag';
12
+    public const BOT_COMMAND = 'bot_command';
13
+    public const URL = 'url';
14
+    public const EMAIL = 'email';
15
+    public const PHONE_NUMBER = 'phone_number';
16
+    public const BOLD = 'bold';
17
+    public const ITALIC = 'italic';
18
+    public const UNDERLINE = 'underline';
19
+    public const STRIKETHROUGH = 'strikethrough';
20
+    public const CODE = 'code';
21
+    public const PRE = 'pre';
22
+    public const TEXT_LINK = 'text_link';
23
+    public const TEXT_MENTION = 'text_mention';
24 24
 }
Please login to merge, or discard this patch.
constants/chatMemberStatus.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -6,21 +6,21 @@
 block discarded – undo
6 6
  * User status in the chat
7 7
  */
8 8
 class chatMemberStatus {
9
-	/** The creator of the chat */
10
-	public const CREATOR = 'creator';
9
+    /** The creator of the chat */
10
+    public const CREATOR = 'creator';
11 11
 
12
-	/** The admin of the chat */
13
-	public const ADMINISTRATOR = 'administrator';
12
+    /** The admin of the chat */
13
+    public const ADMINISTRATOR = 'administrator';
14 14
 
15
-	/** The member of the chat */
16
-	public const MEMBER = 'member';
15
+    /** The member of the chat */
16
+    public const MEMBER = 'member';
17 17
 
18
-	/** Restricted in the chat */
19
-	public const RESTRICTED = 'restricted';
18
+    /** Restricted in the chat */
19
+    public const RESTRICTED = 'restricted';
20 20
 
21
-	/** Left or not joined in the chat */
22
-	public const LEFT = 'left';
21
+    /** Left or not joined in the chat */
22
+    public const LEFT = 'left';
23 23
 
24
-	/** Kicked in the chat */
25
-	public const KICKED = 'kicked';
24
+    /** Kicked in the chat */
25
+    public const KICKED = 'kicked';
26 26
 }
Please login to merge, or discard this patch.