Passed
Push — main ( bfb9d3...b0527a )
by Miaad
01:30
created
settings.php 1 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.
api/request.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -230,8 +230,7 @@  discard block
 block discarded – undo
230 230
             self::keysName($action,$arguments);
231 231
             self::readyFile($action,$arguments);
232 232
             print_r($arguments);
233
-        }
234
-        else {
233
+        } else {
235 234
             logger::write("$name method is not supported",'error');
236 235
         }
237 236
     }
@@ -256,8 +255,7 @@  discard block
 block discarded – undo
256 255
                     $arguments['media'][$key]['media'] = new CURLFile($media['media']);
257 256
                 }
258 257
             }
259
-        }
260
-        elseif ($file_params = self::methodFile($name)) {
258
+        } elseif ($file_params = self::methodFile($name)) {
261 259
             foreach ($file_params as $param) {
262 260
                 if (isset($arguments[$param]) && file_exists($arguments[$param])) {
263 261
                     $arguments[$param] = new CURLFile($arguments[$param]);
Please login to merge, or discard this patch.
logger.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,7 @@
 block discarded – undo
13 13
         if (file_exists('BPT.log') && !(filesize('BPT.log') > self::$log_size * 1024 * 1024)) {
14 14
             $mode = 'a';
15 15
             $write = false;
16
-        }
17
-        else {
16
+        } else {
18 17
             $mode = 'w';
19 18
             $write = true;
20 19
         }
Please login to merge, or discard this patch.
BPT.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@
 block discarded – undo
17 17
     public function __call (string $name, array $arguments) {
18 18
         if (!isset($arguments[1]) && is_array($arguments[0])) {
19 19
             request::$name(...$arguments[0]);
20
-        }
21
-        else {
20
+        } else {
22 21
             request::$name($arguments);
23 22
         }
24 23
     }
Please login to merge, or discard this patch.
types/types.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@
 block discarded – undo
17 17
 		foreach ($update as $key=>$value) {
18 18
 		    if (isset($subs[$key])) {
19 19
 		        $this->$key = new ($subs[$key]) ($value);
20
-		    }
21
-		    else {
20
+		    } else {
22 21
 		        $this->$key = $value;
23 22
 		        if (ucfirst($key) === basename(get_class($this)).'_id') {
24 23
 		            $this->{'id'} = $value;
Please login to merge, or discard this patch.
telegram.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@  discard block
 block discarded – undo
6 6
     public function __call (string $name, array $arguments) {
7 7
         if (!isset($arguments[1]) && is_array($arguments[0])) {
8 8
             request::$name(...$arguments[0]);
9
-        }
10
-        else {
9
+        } else {
11 10
             request::$name($arguments);
12 11
         }
13 12
     }
@@ -15,8 +14,7 @@  discard block
 block discarded – undo
15 14
     public static function __callStatic (string $name, array $arguments) {
16 15
         if (!isset($arguments[1]) && is_array($arguments[0])) {
17 16
             request::$name(...$arguments[0]);
18
-        }
19
-        else {
17
+        } else {
20 18
             request::$name(...$arguments);
21 19
         }
22 20
     }
Please login to merge, or discard this patch.
request.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -230,8 +230,7 @@  discard block
 block discarded – undo
230 230
             self::keysName($action,$arguments);
231 231
             self::readyFile($action,$arguments);
232 232
             print_r($arguments);
233
-        }
234
-        else {
233
+        } else {
235 234
             logger::write("$name method is not supported",'error');
236 235
         }
237 236
     }
@@ -256,8 +255,7 @@  discard block
 block discarded – undo
256 255
                     $arguments['media'][$key]['media'] = new CURLFile($media['media']);
257 256
                 }
258 257
             }
259
-        }
260
-        elseif ($file_params = self::methodFile($name)) {
258
+        } elseif ($file_params = self::methodFile($name)) {
261 259
             foreach ($file_params as $param) {
262 260
                 if (isset($arguments[$param]) && file_exists($arguments[$param])) {
263 261
                     $arguments[$param] = new CURLFile($arguments[$param]);
Please login to merge, or discard this patch.
receiver/multi.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,7 @@
 block discarded – undo
8 8
     public static function init() {
9 9
         if (lock::exist('BPT-MULTI')) {
10 10
 
11
-        }
12
-        else {
11
+        } else {
13 12
 
14 13
         }
15 14
     }
Please login to merge, or discard this patch.
tools.php 1 patch
Braces   +14 added lines, -12 removed lines patch added patch discarded remove patch
@@ -256,15 +256,15 @@  discard block
 block discarded – undo
256 256
             curl_exec($ch);
257 257
             $size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);
258 258
             curl_close($ch);
259
-        }
260
-        else {
259
+        } else {
261 260
             $size = file_exists($path) ? filesize($path) : false;
262 261
         }
263 262
 
264 263
         if (isset($size) && is_numeric($size)) {
265 264
             return $format ? tools::byteFormat($size) : $size;
266
-        }
267
-        else return false;
265
+        } else {
266
+            return false;
267
+        }
268 268
     }
269 269
 
270 270
     //fix methods after here comments
@@ -292,15 +292,16 @@  discard block
 block discarded – undo
292 292
                         $file->isDir() ? rmdir($file->getRealPath()) : unlink($file->getRealPath());
293 293
                     }
294 294
                     rmdir($path);
295
-                }
296
-                else {
295
+                } else {
297 296
                     logger::write("BPT delete function used\ndelete function cannot delete folder because its have subFiles and sub parameter haven't true value",'error');
298 297
                     return false;
299 298
                 }
300
-            }
301
-            else rmdir($path);
302
-        }
303
-        else unlink($path);
299
+            } else {
300
+                rmdir($path);
301
+            }
302
+        } else {
303
+            unlink($path);
304
+        }
304 305
 
305 306
         return true;
306 307
     }
@@ -327,8 +328,9 @@  discard block
 block discarded – undo
327 328
         foreach ($string as $k => &$v) {
328 329
             if ($diff->$v) {
329 330
                 $v = $diff->$v;
330
-            }
331
-            else unset($string[$k]);
331
+            } else {
332
+                unset($string[$k]);
333
+            }
332 334
         }
333 335
         $string['status'] = $status;
334 336
         return count($string) > 1 ? $string : ['status' => 'now'];
Please login to merge, or discard this patch.