Passed
Push — master ( 766cb5...8d3d8e )
by Dyar
01:28
created
main.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,5 +21,5 @@
 block discarded – undo
21 21
 }
22 22
 
23 23
 if (Get::$text == 'hi') Send::sendMessage(Get::$chat_id, 'Hello!');
24
-$admins=explode(',',getenv('ADMINS'));
24
+$admins = explode(',', getenv('ADMINS'));
25 25
 foreach ($admins as $admin) Send::sendMessage($admin, 'bot is run');
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,6 +20,10 @@
 block discarded – undo
20 20
     Get::set($tg->getWebhookUpdates());
21 21
 }
22 22
 
23
-if (Get::$text == 'hi') Send::sendMessage(Get::$chat_id, 'Hello!');
23
+if (Get::$text == 'hi') {
24
+    Send::sendMessage(Get::$chat_id, 'Hello!');
25
+}
24 26
 $admins=explode(',',getenv('ADMINS'));
25
-foreach ($admins as $admin) Send::sendMessage($admin, 'bot is run');
27
+foreach ($admins as $admin) {
28
+    Send::sendMessage($admin, 'bot is run');
29
+}
Please login to merge, or discard this patch.
src/DB/Json.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
137 137
         $fileName = $this->DBDir . '/' . $DBName . '/' . $TableName . '.json';
138 138
         if (is_file($fileName)) {
139 139
             $out = json_decode(file_get_contents($fileName));
140
-            $i=-1;
140
+            $i = -1;
141 141
             foreach ($out as $item) {
142 142
                 $i++;
143 143
                 $res = true;
Please login to merge, or discard this patch.
src/DB/DB.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
     public static function Database()
19 19
     {
20 20
         $DB = getenv('DB');
21
-        if     ($DB == 'json') self::$instance = new Json();
21
+        if ($DB == 'json') self::$instance = new Json();
22 22
         elseif ($DB == 'mysql') self::$instance = new Mysql();
23 23
         elseif ($DB == 'mongodb') self::$instance = new MongoDB();
24 24
         return self::$instance;
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,9 +18,13 @@
 block discarded – undo
18 18
     public static function Database()
19 19
     {
20 20
         $DB = getenv('DB');
21
-        if     ($DB == 'json') self::$instance = new Json();
22
-        elseif ($DB == 'mysql') self::$instance = new Mysql();
23
-        elseif ($DB == 'mongodb') self::$instance = new MongoDB();
21
+        if     ($DB == 'json') {
22
+            self::$instance = new Json();
23
+        } elseif ($DB == 'mysql') {
24
+            self::$instance = new Mysql();
25
+        } elseif ($DB == 'mongodb') {
26
+            self::$instance = new MongoDB();
27
+        }
24 28
         return self::$instance;
25 29
 
26 30
     }
Please login to merge, or discard this patch.
src/Get.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -96,21 +96,21 @@
 block discarded – undo
96 96
                 self::$reply_to_from_language_code = $input->$type->reply_to_message->from->language_code ?? null;
97 97
                 self::$reply_to_text = $input->$type->reply_to_message->text ?? null;
98 98
                 self::$reply_to_caption = $input->$type->reply_to_message->caption ?? null;
99
-            } elseif(isset($input->message->new_chat_member)){
99
+            } elseif (isset($input->message->new_chat_member)) {
100 100
                 self::$new_chat_member_id = $input->message->new_chat_member->id;
101 101
                 self::$new_chat_member_is_bot = $input->message->new_chat_member->is_bot;
102 102
                 self::$new_chat_member_first_name = $input->message->new_chat_member->first_name ?? null;
103 103
                 self::$new_chat_member_last_name = $input->message->new_chat_member->last_name ?? null;
104 104
                 self::$new_chat_member_username = $input->message->new_chat_member->username ?? null;
105 105
                 self::$new_chat_member_language_code = $input->message->new_chat_member->language_code ?? null;
106
-            } elseif(isset($input->message->forward_from_chat)){
106
+            } elseif (isset($input->message->forward_from_chat)) {
107 107
                 self::$forward_from_chat_id = $input->message->forward_from_chat->id;
108 108
                 self::$forward_from_chat_type = $input->message->forward_from_chat->type;
109 109
                 self::$forward_from_chat_title = $input->message->forward_from_chat->title;
110 110
                 self::$forward_from_chat_username = $input->message->forward_from_chat->username ?? null;
111
-            } elseif(isset($input->message->new_chat_photo)){
111
+            } elseif (isset($input->message->new_chat_photo)) {
112 112
                 self::$new_chat_photo_file_id = $input->message->new_chat_photo->file_id;
113
-            } elseif(isset($input->message->new_chat_title)){
113
+            } elseif (isset($input->message->new_chat_title)) {
114 114
                 self::$new_chat_title = $input->message->new_chat_title;
115 115
             }
116 116
         } elseif (isset($input->callback_query)) {
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,8 +65,11 @@
 block discarded – undo
65 65
     public static function set($input)
66 66
     {
67 67
         if (isset($input->message) || isset($input->edited_message)) {
68
-            if (isset($input->message)) $type = 'message';
69
-            else $type = 'edited_message';
68
+            if (isset($input->message)) {
69
+                $type = 'message';
70
+            } else {
71
+                $type = 'edited_message';
72
+            }
70 73
             //
71 74
             self::$message_id = $input->$type->message_id;
72 75
             //
Please login to merge, or discard this patch.
src/Bootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
         $envPathExample = $envPath . '.example';
11 11
 
12 12
         if (!is_file($envPath) || filesize($envPath) === 0) {
13
-            copy($envPathExample,$envPath);
13
+            copy($envPathExample, $envPath);
14 14
         }
15 15
         require_once $envPath;
16 16
         if (getenv('VERSION') !== ENV_VERSION) {
Please login to merge, or discard this patch.
src/jdf.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -332,7 +332,7 @@
 block discarded – undo
332 332
  */
333 333
 function gregorian_to_jalali($gy, $gm, $gd, $mod = '')
334 334
 {
335
-    list($gy, $gm, $gd) = explode('_', tr_num($gy . '_' . $gm . '_' . $gd));/* <= Extra :اين سطر ، جزء تابع اصلي نيست */
335
+    list($gy, $gm, $gd) = explode('_', tr_num($gy . '_' . $gm . '_' . $gd)); /* <= Extra :اين سطر ، جزء تابع اصلي نيست */
336 336
     $g_d_m = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
337 337
     if ($gy > 1600) {
338 338
         $jy = 979;
Please login to merge, or discard this patch.
Hook.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@
 block discarded – undo
4 4
 if (isset($input)) {
5 5
     $telegram_ip_ranges = [
6 6
         ['lower' => '149.154.160.0', 'upper' => '149.154.175.255'],
7
-        ['lower' => '91.108.4.0',    'upper' => '91.108.7.255'],
7
+        ['lower' => '91.108.4.0', 'upper' => '91.108.7.255'],
8 8
     ];
9
-    $ip_dec = (float) sprintf("%u", ip2long($_SERVER['REMOTE_ADDR']));
9
+    $ip_dec = (float)sprintf("%u", ip2long($_SERVER['REMOTE_ADDR']));
10 10
     $ok = false;
11 11
     foreach ($telegram_ip_ranges as $telegram_ip_range) {
12
-        $lower_dec = (float) sprintf("%u", ip2long($telegram_ip_range['lower']));
13
-        $upper_dec = (float) sprintf("%u", ip2long($telegram_ip_range['upper']));
12
+        $lower_dec = (float)sprintf("%u", ip2long($telegram_ip_range['lower']));
13
+        $upper_dec = (float)sprintf("%u", ip2long($telegram_ip_range['upper']));
14 14
         if ($ip_dec >= $lower_dec and $ip_dec <= $upper_dec) {
15 15
             $ok = true;
16 16
             break;
Please login to merge, or discard this patch.