Passed
Push — main ( b5c504...2690c9 )
by Alireza
01:51 queued 21s
created
settings.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
     public static int $log_size = 10;
25 25
 
26
-    public static string|CURLFile|null $certificate = null;
26
+    public static string | CURLFile | null $certificate = null;
27 27
 
28 28
     public static bool $handler = true;
29 29
 
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 
54 54
     public static array $allowed_updates = ['message', 'edited_channel_post', 'callback_query', 'inline_query'];
55 55
 
56
-    public static array|mysqli|null $db = ['type' => 'json', 'file_name' => 'BPT-DB.json'];
56
+    public static array | mysqli | null $db = ['type' => 'json', 'file_name' => 'BPT-DB.json'];
57 57
 
58 58
 
59
-    public static function init (array|stdClass $settings) {
59
+    public static function init(array | stdClass $settings) {
60 60
         $settings = (array) $settings;
61 61
 
62 62
         if (!(isset($settings['logger']) && $settings['logger'] == false)) {
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
         }
65 65
 
66 66
         foreach ($settings as $setting => $value) {
67
-            try{
67
+            try {
68 68
                 self::$$setting = $value;
69 69
             }
70
-            catch (TypeError){
71
-                logger::write("$setting setting has wrong type , its set to default value",loggerTypes::WARNING);
70
+            catch (TypeError) {
71
+                logger::write("$setting setting has wrong type , its set to default value", loggerTypes::WARNING);
72 72
             }
73
-            catch (Error){
74
-                logger::write("$setting setting is not one of library settings",loggerTypes::WARNING);
73
+            catch (Error) {
74
+                logger::write("$setting setting is not one of library settings", loggerTypes::WARNING);
75 75
             }
76 76
         }
77 77
 
@@ -83,12 +83,12 @@  discard block
 block discarded – undo
83 83
                 self::$receiver !== receiver::GETUPDATES ? self::webhook() : self::getUpdates();
84 84
             }
85 85
             else {
86
-                logger::write('token format is not right, check it and try again',loggerTypes::ERROR);
86
+                logger::write('token format is not right, check it and try again', loggerTypes::ERROR);
87 87
                 throw new bptException('TOKEN_NOT_TRUE');
88 88
             }
89 89
         }
90 90
         else {
91
-            logger::write('You must specify token parameter in settings',loggerTypes::ERROR);
91
+            logger::write('You must specify token parameter in settings', loggerTypes::ERROR);
92 92
             throw new bptException('TOKEN_NOT_FOUND');
93 93
         }
94 94
     }
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         if (self::$secure_folder) {
113 113
             $address = explode('/', $_SERVER['REQUEST_URI']);
114 114
             unset($address[count($address) - 1]);
115
-            $address = implode('/', $address) . '/BPT.php';
115
+            $address = implode('/', $address).'/BPT.php';
116 116
             $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>";
117 117
             if (!file_exists('.htaccess') || filesize('.htaccess') != strlen($text)) {
118 118
                 file_put_contents('.htaccess', $text);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             getUpdates::init();
132 132
         }
133 133
         else {
134
-            logger::write('You can\'t use getUpdates receiver when handler is off , use webhook or use handler',loggerTypes::ERROR);
134
+            logger::write('You can\'t use getUpdates receiver when handler is off , use webhook or use handler', loggerTypes::ERROR);
135 135
             throw new bptException('GETUPDATE_NEED_HANDLER');
136 136
         }
137 137
     }
Please login to merge, or discard this patch.
database/database.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@
 block discarded – undo
17 17
    /**
18 18
    * @const types database
19 19
    */
20
-   const TYPES = array('Mysqli','Medoo','Json');
20
+   const TYPES = array('Mysqli', 'Medoo', 'Json');
21 21
  
22 22
    /**
23 23
     * @const Medoo database types
24 24
     */
25
-   const Medoo_Types = array('mysql','mariadb','pgsql','sybase','oracle','mssql', 'sqlite');
25
+   const Medoo_Types = array('mysql', 'mariadb', 'pgsql', 'sybase', 'oracle', 'mssql', 'sqlite');
26 26
 
27 27
     /**
28 28
      * @var type database
Please login to merge, or discard this patch.