Passed
Push — main ( 95c480...ee195b )
by Miaad
01:34
created
src/receiver/receiver.php 1 patch
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -85,51 +85,41 @@
 block discarded – undo
85 85
                 if (self::handlerExist('message')) {
86 86
                     BPT::$handler->message(BPT::$update->message);
87 87
                 }
88
-            }
89
-            elseif (isset(BPT::$update->edited_message)) {
88
+            } elseif (isset(BPT::$update->edited_message)) {
90 89
                 if (self::handlerExist('edited_message')) {
91 90
                     BPT::$handler->edited_message(BPT::$update->edited_message);
92 91
                 }
93
-            }
94
-            elseif (isset(BPT::$update->channel_post)) {
92
+            } elseif (isset(BPT::$update->channel_post)) {
95 93
                 if (self::handlerExist('channel_post')) {
96 94
                     BPT::$handler->channel_post(BPT::$update->channel_post);
97 95
                 }
98
-            }
99
-            elseif (isset(BPT::$update->edited_channel_post)) {
96
+            } elseif (isset(BPT::$update->edited_channel_post)) {
100 97
                 if (self::handlerExist('edited_channel_post')) {
101 98
                     BPT::$handler->edited_channel_post(BPT::$update->edited_channel_post);
102 99
                 }
103
-            }
104
-            elseif (isset(BPT::$update->inline_query)) {
100
+            } elseif (isset(BPT::$update->inline_query)) {
105 101
                 if (self::handlerExist('inline_query')) {
106 102
                     BPT::$handler->inline_query(BPT::$update->inline_query);
107 103
                 }
108
-            }
109
-            elseif (isset(BPT::$update->callback_query)) {
104
+            } elseif (isset(BPT::$update->callback_query)) {
110 105
                 if (self::handlerExist('callback_query')) {
111 106
                     BPT::$handler->callback_query(BPT::$update->callback_query);
112 107
                 }
113
-            }
114
-            elseif (isset(BPT::$update->my_chat_member)) {
108
+            } elseif (isset(BPT::$update->my_chat_member)) {
115 109
                 if (self::handlerExist('my_chat_member')) {
116 110
                     BPT::$handler->my_chat_member(BPT::$update->my_chat_member);
117 111
                 }
118
-            }
119
-            elseif (isset(BPT::$update->chat_member)) {
112
+            } elseif (isset(BPT::$update->chat_member)) {
120 113
                 if (self::handlerExist('chat_member')) {
121 114
                     BPT::$handler->chat_member(BPT::$update->chat_member);
122 115
                 }
123
-            }
124
-            elseif (isset(BPT::$update->chat_join_request)) {
116
+            } elseif (isset(BPT::$update->chat_join_request)) {
125 117
                 if (self::handlerExist('chat_join_request')) {
126 118
                     BPT::$handler->chat_join_request(BPT::$update->chat_join_request);
127 119
                 }
128
-            }
129
-            elseif (self::handlerExist('something_else')) {
120
+            } elseif (self::handlerExist('something_else')) {
130 121
                 BPT::$handler->something_else(BPT::$update);
131
-            }
132
-            else {
122
+            } else {
133 123
                 logger::write('Update received but handlers are not set',loggerTypes::WARNING);
134 124
             }
135 125
         }
Please login to merge, or discard this patch.
src/tools.php 1 patch
Braces   +35 added lines, -34 removed lines patch added patch discarded remove patch
@@ -217,8 +217,9 @@  discard block
 block discarded – undo
217 217
             if (telegram::$status) {
218 218
                 $check = $check->status;
219 219
                 $result[$id] = $check !== chatMemberStatus::LEFT && $check !== chatMemberStatus::KICKED;
220
+            } else {
221
+                $result[$id] = null;
220 222
             }
221
-            else $result[$id] = null;
222 223
         }
223 224
         return $result;
224 225
     }
@@ -259,8 +260,7 @@  discard block
 block discarded – undo
259 260
             curl_exec($ch);
260 261
             $size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);
261 262
             curl_close($ch);
262
-        }
263
-        else {
263
+        } else {
264 264
             $path = realpath($path);
265 265
             $size = file_exists($path) ? filesize($path) : false;
266 266
         }
@@ -331,8 +331,7 @@  discard block
 block discarded – undo
331 331
                     $zip->addFile($filePath, substr($filePath, $root_len));
332 332
                 }
333 333
             }
334
-        }
335
-        else {
334
+        } else {
336 335
             $zip->addFile($path, basename($path));
337 336
         }
338 337
         return $zip->close();
@@ -351,9 +350,13 @@  discard block
 block discarded – undo
351 350
      */
352 351
     public static function downloadFile (string $url, string $path,int $chunk_size = 512): bool {
353 352
         $file = fopen($url, 'rb');
354
-        if (!$file) return false;
353
+        if (!$file) {
354
+            return false;
355
+        }
355 356
         $path = fopen($path, 'wb');
356
-        if (!$path) return false;
357
+        if (!$path) {
358
+            return false;
359
+        }
357 360
 
358 361
         $length = $chunk_size * 1024;
359 362
         while (!feof($file)){
@@ -460,8 +463,9 @@  discard block
 block discarded – undo
460 463
         foreach ($string as $k => &$v) {
461 464
             if ($diff->$v) {
462 465
                 $v = $diff->$v;
466
+            } else {
467
+                unset($string[$k]);
463 468
             }
464
-            else unset($string[$k]);
465 469
         }
466 470
         $string['status'] = $base_time < $target_time ? 'later' : 'ago';
467 471
 
@@ -527,8 +531,7 @@  discard block
 block discarded – undo
527 531
             if ($last === "\0") {
528 532
                 $new .= str_repeat($last, ord($char));
529 533
                 $last = '';
530
-            }
531
-            else {
534
+            } else {
532 535
                 $new .= $last;
533 536
                 $last = $char;
534 537
             }
@@ -612,7 +615,9 @@  discard block
 block discarded – undo
612 615
             }
613 616
             $rows = [];
614 617
             foreach ($keyboard as $row) {
615
-                if (!is_array($row)) continue;
618
+                if (!is_array($row)) {
619
+                    continue;
620
+                }
616 621
                 $buttons = [];
617 622
                 foreach ($row as $base_button) {
618 623
                     $button_info = explode('||', $base_button);
@@ -621,15 +626,12 @@  discard block
 block discarded – undo
621 626
                     if (count($button_info) > 1) {
622 627
                         if ($button_info[1] === 'con') {
623 628
                             $button->setRequest_contact(true);
624
-                        }
625
-                        elseif ($button_info[1] === 'loc') {
629
+                        } elseif ($button_info[1] === 'loc') {
626 630
                             $button->setRequest_location(true);
627
-                        }
628
-                        elseif ($button_info[1] === 'poll') {
631
+                        } elseif ($button_info[1] === 'poll') {
629 632
                             $type = $button_info[2] === pollType::QUIZ ? pollType::QUIZ : pollType::REGULAR;
630 633
                             $button->setRequest_poll((new keyboardButtonPollType())->setType($type));
631
-                        }
632
-                        elseif ($button_info[1] === 'web' && isset($button_info[2])) {
634
+                        } elseif ($button_info[1] === 'web' && isset($button_info[2])) {
633 635
                             $url = $button_info[2];
634 636
                             $button->setWeb_app((new webAppInfo())->setUrl($url));
635 637
                         }
@@ -640,8 +642,7 @@  discard block
 block discarded – undo
640 642
             }
641 643
             $keyboard_object->setKeyboard($rows);
642 644
             return $keyboard_object;
643
-        }
644
-        elseif (!empty($inline)) {
645
+        } elseif (!empty($inline)) {
645 646
             $keyboard_object = new inlineKeyboardMarkup();
646 647
             $rows = [];
647 648
             foreach ($inline as $row) {
@@ -651,12 +652,10 @@  discard block
 block discarded – undo
651 652
                     if (isset($button_info[1])) {
652 653
                         if (filter_var($button_info[1], FILTER_VALIDATE_URL) && str_starts_with($button_info[1], 'http')) {
653 654
                             $button->setText($button_info[0])->setUrl($button_info[1]);
654
-                        }
655
-                        else {
655
+                        } else {
656 656
                             $button->setText($button_info[0])->setCallback_data($button_info[1]);
657 657
                         }
658
-                    }
659
-                    else {
658
+                    } else {
660 659
                         $button->setText($button_info[0])->setUrl('https://t.me/BPT_CH');
661 660
                     }
662 661
                     $buttons[] = $button;
@@ -665,8 +664,7 @@  discard block
 block discarded – undo
665 664
             }
666 665
             $keyboard_object->setInline_keyboard($rows);
667 666
             return $keyboard_object;
668
-        }
669
-        else {
667
+        } else {
670 668
             logger::write("tools::eKey function used\nkeyboard or inline parameter must be set",loggerTypes::ERROR);
671 669
             throw new bptException('ARGUMENT_NOT_FOUND_KEYBOARD_INLINE');
672 670
         }
@@ -685,8 +683,12 @@  discard block
 block discarded – undo
685 683
      * @return string
686 684
      */
687 685
     public static function inviteLink (int $user_id = null, string $bot_username = null): string {
688
-        if (empty($user_id)) $user_id = telegram::catchFields(fields::USER_ID);
689
-        if (empty($bot_username)) $bot_username = telegram::getMe()->username;
686
+        if (empty($user_id)) {
687
+            $user_id = telegram::catchFields(fields::USER_ID);
688
+        }
689
+        if (empty($bot_username)) {
690
+            $bot_username = telegram::getMe()->username;
691
+        }
690 692
         return 'https://t.me/' . str_replace('@', '', $bot_username) . '?start=ref_' . tools::shortEncode($user_id);
691 693
     }
692 694
 
@@ -721,8 +723,7 @@  discard block
 block discarded – undo
721 723
             $iv = self::randomString();
722 724
             $output = base64_encode(openssl_encrypt($text, 'AES-256-CBC', $key, 1, $iv));
723 725
             return ['hash' => $output, 'key' => $key, 'iv' => $iv];
724
-        }
725
-        elseif ($action === codecAction::DECRYPT) {
726
+        } elseif ($action === codecAction::DECRYPT) {
726 727
             if (empty($key)) {
727 728
                 logger::write("tools::codec function used\nkey parameter is not set",loggerTypes::ERROR);
728 729
                 throw new bptException('ARGUMENT_NOT_FOUND_KEY');
@@ -732,8 +733,7 @@  discard block
 block discarded – undo
732 733
                 throw new bptException('ARGUMENT_NOT_FOUND_IV');
733 734
             }
734 735
             return openssl_decrypt(base64_decode($text), 'AES-256-CBC', $key, 1, $iv);
735
-        }
736
-        else {
736
+        } else {
737 737
             logger::write("tools::codec function used\naction is not right, its must be `encode` or `decode`",loggerTypes::WARNING);
738 738
             return false;
739 739
         }
@@ -762,7 +762,9 @@  discard block
 block discarded – undo
762 762
             $array[] = $num % 62;
763 763
             $num = floor($num / 62);
764 764
         }
765
-        if (count($array) < 1) $array = [0];
765
+        if (count($array) < 1) {
766
+            $array = [0];
767
+        }
766 768
         foreach ($array as &$value) {
767 769
             $value = $codes[$value];
768 770
         }
@@ -797,8 +799,7 @@  discard block
 block discarded – undo
797 799
         $ip = $_SERVER['REMOTE_ADDR'];
798 800
         if (settings::$cloudflare_verify && isset($_SERVER['HTTP_CF_CONNECTING_IP']) && tools::isCloudFlare($ip)) {
799 801
             $ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
800
-        }
801
-        elseif (settings::$arvancloud_verify && isset($_SERVER['HTTP_AR_REAL_IP']) && tools::isArvanCloud($ip)) {
802
+        } elseif (settings::$arvancloud_verify && isset($_SERVER['HTTP_AR_REAL_IP']) && tools::isArvanCloud($ip)) {
802 803
             $ip = $_SERVER['HTTP_AR_REAL_IP'];
803 804
         }
804 805
         return $ip;
Please login to merge, or discard this patch.
src/telegram/request/answer.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,8 +49,7 @@
 block discarded – undo
49 49
         foreach ($data as $key=>&$value){
50 50
             if (!isset($value)){
51 51
                 unset($data[$key]);
52
-            }
53
-            elseif (is_array($value) || is_object($value)){
52
+            } elseif (is_array($value) || is_object($value)){
54 53
                 $value = json_encode($value);
55 54
             }
56 55
         }
Please login to merge, or discard this patch.
src/telegram/request.php 1 patch
Braces   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -811,19 +811,16 @@  discard block
 block discarded – undo
811 811
             foreach ($arguments['media'] as $key => $media) {
812 812
                 if ($media['media'] instanceof CURLFile) {
813 813
                     $remove_answer = true;
814
-                }
815
-                elseif (is_string($media['media']) && file_exists(realpath($media['media']))) {
814
+                } elseif (is_string($media['media']) && file_exists(realpath($media['media']))) {
816 815
                     $arguments['media'][$key]['media'] = new CURLFile($media['media']);
817 816
                     $remove_answer = true;
818 817
                 }
819 818
             }
820
-        }
821
-        elseif ($file_params = self::methodFile($name)) {
819
+        } elseif ($file_params = self::methodFile($name)) {
822 820
             foreach ($file_params as $param) {
823 821
                 if ($arguments[$param] instanceof CURLFile) {
824 822
                     $remove_answer = true;
825
-                }
826
-                elseif (isset($arguments[$param]) && is_string($arguments[$param]) && file_exists(realpath($arguments[$param]))) {
823
+                } elseif (isset($arguments[$param]) && is_string($arguments[$param]) && file_exists(realpath($arguments[$param]))) {
827 824
                     $arguments[$param] = new CURLFile($arguments[$param]);
828 825
                     $remove_answer = true;
829 826
                 }
@@ -861,8 +858,7 @@  discard block
 block discarded – undo
861 858
                 if (!isset($arguments[$default])){
862 859
                     $arguments[$default] = self::catchFields($default);
863 860
                 }
864
-            }
865
-            elseif (isset(BPT::$update->$key) || $key === 'other') {
861
+            } elseif (isset(BPT::$update->$key) || $key === 'other') {
866 862
                 foreach ($default as $def) {
867 863
                     if (!isset($arguments[$def])){
868 864
                         $arguments[$def] = self::catchFields($def);
@@ -919,9 +915,13 @@  discard block
 block discarded – undo
919 915
                     default => false
920 916
                 };
921 917
             case fields::FILE_ID :
922
-                if (isset(BPT::$update->message)) $type = 'message';
923
-                elseif (isset(BPT::$update->edited_message)) $type = 'edited_message';
924
-                else return false;
918
+                if (isset(BPT::$update->message)) {
919
+                    $type = 'message';
920
+                } elseif (isset(BPT::$update->edited_message)) {
921
+                    $type = 'edited_message';
922
+                } else {
923
+                    return false;
924
+                }
925 925
 
926 926
                 return match(true) {
927 927
                     isset(BPT::$update->$type->animation) => BPT::$update->$type->animation->file_id,
Please login to merge, or discard this patch.
src/external/jdf.php 1 patch
Braces   +50 added lines, -35 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@  discard block
 block discarded – undo
12 12
 class jdf {
13 13
     public static function jdate ($format, $timestamp = '', $none = '', $time_zone = 'Asia/Tehran', $tr_num = 'fa') {
14 14
         $T_sec = 0;/* <= رفع خطاي زمان سرور ، با اعداد '+' و '-' بر حسب ثانيه */
15
-        if ($time_zone != 'local') date_default_timezone_set(($time_zone === '') ? 'Asia/Tehran' : $time_zone);
15
+        if ($time_zone != 'local') {
16
+            date_default_timezone_set(($time_zone === '') ? 'Asia/Tehran' : $time_zone);
17
+        }
16 18
         $ts = $T_sec + (($timestamp === '') ? time() : self::tr_num($timestamp));
17 19
         $date = explode('_', date('H_i_j_n_O_P_s_w_Y', $ts));
18 20
         [$j_y, $j_m, $j_d] = self::gregorian_to_jalali($date[8], $date[3], $date[2]);
@@ -155,16 +157,19 @@  discard block
 block discarded – undo
155 157
                     break;
156 158
                 case 'W':
157 159
                     $avs = (($date[7] == 6) ? 0 : $date[7] + 1) - ($doy % 7);
158
-                    if ($avs < 0) $avs += 7;
160
+                    if ($avs < 0) {
161
+                        $avs += 7;
162
+                    }
159 163
                     $num = (int) (($doy + $avs) / 7);
160 164
                     if ($avs < 4) {
161 165
                         $num++;
162
-                    }
163
-                    elseif ($num < 1) {
166
+                    } elseif ($num < 1) {
164 167
                         $num = ($avs == 4 or $avs == ((((($j_y % 33) % 4) - 2) == ((int) (($j_y % 33) * 0.05))) ? 5 : 4)) ? 53 : 52;
165 168
                     }
166 169
                     $aks = $avs + $kab;
167
-                    if ($aks == 7) $aks = 0;
170
+                    if ($aks == 7) {
171
+                        $aks = 0;
172
+                    }
168 173
                     $out .= (($kab + 363 - $doy) < $aks and $aks < 3) ? '01' : (($num < 10) ? '0' . $num : $num);
169 174
                     break;
170 175
                 case 'y':
@@ -184,7 +189,9 @@  discard block
 block discarded – undo
184 189
     }
185 190
     public static function jstrftime ($format, $timestamp = '', $none = '', $time_zone = 'Asia/Tehran', $tr_num = 'fa') {
186 191
         $T_sec = 0;/* <= رفع خطاي زمان سرور ، با اعداد '+' و '-' بر حسب ثانيه */
187
-        if ($time_zone != 'local') date_default_timezone_set(($time_zone === '') ? 'Asia/Tehran' : $time_zone);
192
+        if ($time_zone != 'local') {
193
+            date_default_timezone_set(($time_zone === '') ? 'Asia/Tehran' : $time_zone);
194
+        }
188 195
         $ts = $T_sec + (($timestamp === '') ? time() : self::tr_num($timestamp));
189 196
         $date = explode('_', date('h_H_i_j_n_s_w_Y', $ts));
190 197
         [$j_y, $j_m, $j_d] = self::gregorian_to_jalali($date[7], $date[4], $date[3]);
@@ -196,8 +203,7 @@  discard block
 block discarded – undo
196 203
             $sub = substr($format, $i, 1);
197 204
             if ($sub == '%') {
198 205
                 $sub = substr($format, ++$i, 1);
199
-            }
200
-            else {
206
+            } else {
201 207
                 $out .= $sub;
202 208
                 continue;
203 209
             }
@@ -228,30 +234,41 @@  discard block
 block discarded – undo
228 234
                 /* Week */
229 235
                 case 'U':
230 236
                 $avs = (($date[6] < 5) ? $date[6] + 2 : $date[6] - 5) - ($doy % 7);
231
-                if ($avs < 0) $avs += 7;
237
+                if ($avs < 0) {
238
+                    $avs += 7;
239
+                }
232 240
                 $num = (int) (($doy + $avs) / 7) + 1;
233
-                if ($avs > 3 or $avs == 1) $num--;
241
+                if ($avs > 3 or $avs == 1) {
242
+                    $num--;
243
+                }
234 244
                 $out .= ($num < 10) ? '0' . $num : $num;
235 245
                 break;
236 246
                 case 'V':
237 247
                     $avs = (($date[6] == 6) ? 0 : $date[6] + 1) - ($doy % 7);
238
-                    if ($avs < 0) $avs += 7;
248
+                    if ($avs < 0) {
249
+                        $avs += 7;
250
+                    }
239 251
                     $num = (int) (($doy + $avs) / 7);
240 252
                     if ($avs < 4) {
241 253
                         $num++;
242
-                    }
243
-                    elseif ($num < 1) {
254
+                    } elseif ($num < 1) {
244 255
                         $num = ($avs == 4 or $avs == ((((($j_y % 33) % 4) - 2) == ((int) (($j_y % 33) * 0.05))) ? 5 : 4)) ? 53 : 52;
245 256
                     }
246 257
                     $aks = $avs + $kab;
247
-                    if ($aks == 7) $aks = 0;
258
+                    if ($aks == 7) {
259
+                        $aks = 0;
260
+                    }
248 261
                     $out .= (($kab + 363 - $doy) < $aks and $aks < 3) ? '01' : (($num < 10) ? '0' . $num : $num);
249 262
                     break;
250 263
                 case 'W':
251 264
                     $avs = (($date[6] == 6) ? 0 : $date[6] + 1) - ($doy % 7);
252
-                    if ($avs < 0) $avs += 7;
265
+                    if ($avs < 0) {
266
+                        $avs += 7;
267
+                    }
253 268
                     $num = (int) (($doy + $avs) / 7) + 1;
254
-                    if ($avs > 3) $num--;
269
+                    if ($avs > 3) {
270
+                        $num--;
271
+                    }
255 272
                     $out .= ($num < 10) ? '0' . $num : $num;
256 273
                     break;
257 274
                 /* Month */
@@ -360,11 +377,12 @@  discard block
 block discarded – undo
360 377
         return ($tr_num != 'en') ? self::tr_num($out, 'fa', '.') : $out;
361 378
     }
362 379
     public static function jmktime ($h = '', $m = '', $s = '', $jm = '', $jd = '', $jy = '', $none = '', $timezone = 'Asia/Tehran') {
363
-        if ($timezone != 'local') date_default_timezone_set($timezone);
380
+        if ($timezone != 'local') {
381
+            date_default_timezone_set($timezone);
382
+        }
364 383
         if ($h === '') {
365 384
             return time();
366
-        }
367
-        else {
385
+        } else {
368 386
             [
369 387
                 $h,
370 388
                 $m,
@@ -375,27 +393,22 @@  discard block
 block discarded – undo
375 393
             ] = explode('_', self::tr_num($h . '_' . $m . '_' . $s . '_' . $jm . '_' . $jd . '_' . $jy));
376 394
             if ($m === '') {
377 395
                 return mktime($h);
378
-            }
379
-            else {
396
+            } else {
380 397
                 if ($s === '') {
381 398
                     return mktime($h, $m);
382
-                }
383
-                else {
399
+                } else {
384 400
                     if ($jm === '') {
385 401
                         return mktime($h, $m, $s);
386
-                    }
387
-                    else {
402
+                    } else {
388 403
                         $jdate = explode('_', self::jdate('Y_j', '', '', $timezone, 'en'));
389 404
                         if ($jd === '') {
390 405
                             [$gy, $gm, $gd] = self::jalali_to_gregorian($jdate[0], $jm, $jdate[1]);
391 406
                             return mktime($h, $m, $s, $gm);
392
-                        }
393
-                        else {
407
+                        } else {
394 408
                             if ($jy === '') {
395 409
                                 [$gy, $gm, $gd] = self::jalali_to_gregorian($jdate[0], $jm, $jd);
396 410
                                 return mktime($h, $m, $s, $gm, $gd);
397
-                            }
398
-                            else {
411
+                            } else {
399 412
                                 [$gy, $gm, $gd] = self::jalali_to_gregorian($jy, $jm, $jd);
400 413
                                 return mktime($h, $m, $s, $gm, $gd, $gy);
401 414
                             }
@@ -445,8 +458,7 @@  discard block
 block discarded – undo
445 458
                         $p34 = '';
446 459
                         $k34 = ['ده', 'یازده', 'دوازده', 'سیزده', 'چهارده', 'پانزده', 'شانزده', 'هفده', 'هجده', 'نوزده'];
447 460
                         $h34 = $k34[substr($num, 2 - $sl, 2) - 10];
448
-                    }
449
-                    else {
461
+                    } else {
450 462
                         $xy4 = substr($num, 3 - $sl, 1);
451 463
                         $p34 = ($xy3 == 0 or $xy4 == 0) ? '' : ' و ';
452 464
                         $k3 = ['', '', 'بیست', 'سی', 'چهل', 'پنجاه', 'شصت', 'هفتاد', 'هشتاد', 'نود'];
@@ -561,8 +573,7 @@  discard block
 block discarded – undo
561 573
         if ($days < 186) {
562 574
             $jm = 1 + (int) ($days / 31);
563 575
             $jd = 1 + ($days % 31);
564
-        }
565
-        else {
576
+        } else {
566 577
             $jm = 7 + (int) (($days - 186) / 30);
567 578
             $jd = 1 + (($days - 186) % 30);
568 579
         }
@@ -577,7 +588,9 @@  discard block
 block discarded – undo
577 588
         if ($days > 36524) {
578 589
             $gy += 100 * ((int) (--$days / 36524));
579 590
             $days %= 36524;
580
-            if ($days >= 365) $days++;
591
+            if ($days >= 365) {
592
+                $days++;
593
+            }
581 594
         }
582 595
         $gy += 4 * ((int) ($days / 1461));
583 596
         $days %= 1461;
@@ -601,7 +614,9 @@  discard block
 block discarded – undo
601 614
             30,
602 615
             31
603 616
         ];
604
-        for ($gm = 0; $gm < 13 and $gd > $sal_a[$gm]; $gm++) $gd -= $sal_a[$gm];
617
+        for ($gm = 0; $gm < 13 and $gd > $sal_a[$gm]; $gm++) {
618
+            $gd -= $sal_a[$gm];
619
+        }
605 620
         return ($mod == '') ? [$gy, $gm, $gd] : $gy . $mod . $gm . $mod . $gd;
606 621
     }
607 622
 }
608 623
\ No newline at end of file
Please login to merge, or discard this patch.