Passed
Push — master ( 826987...32a961 )
by John
04:26
created
app/Providers/RouteServiceProvider.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
     protected function mapWebRoutes()
53 53
     {
54 54
         Route::middleware('web')
55
-             ->namespace($this->namespace)
56
-             ->group(base_path('routes/web.php'));
55
+                ->namespace($this->namespace)
56
+                ->group(base_path('routes/web.php'));
57 57
     }
58 58
 
59 59
     /**
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
     protected function mapApiRoutes()
67 67
     {
68 68
         Route::prefix('api')
69
-             ->middleware('api')
70
-             ->namespace($this->namespace)
71
-             ->group(base_path('routes/api.php'));
69
+                ->middleware('api')
70
+                ->namespace($this->namespace)
71
+                ->group(base_path('routes/api.php'));
72 72
     }
73 73
 }
Please login to merge, or discard this patch.
app/Models/ResponseModel.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
             $statusCode=200;
15 15
         }
16 16
         $output=[
17
-             'ret' => $statusCode,
17
+                'ret' => $statusCode,
18 18
             'desc' => is_null($desc) ? self::desc($statusCode) : $desc,
19 19
             'data' => $data
20 20
         ];
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
             $statusCode=1000;
28 28
         }
29 29
         $output=[
30
-             'ret' => $statusCode,
30
+                'ret' => $statusCode,
31 31
             'desc' => is_null($desc) ? self::desc($statusCode) : $desc,
32 32
             'data' => $data
33 33
         ];
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
             '451'  => "Unavailable For Legal Reasons",
45 45
 
46 46
             '1000' => "Unspecified Response", /** Under normal condictions those errors shouldn't been displayed to end users
47
-                                                 *  unless they attempt to do so, some submissions should be intercepted
48
-                                                 *  by the frontend before the request sended
49
-                                                 */
47
+             *  unless they attempt to do so, some submissions should be intercepted
48
+             *  by the frontend before the request sended
49
+             */
50 50
             '1001' => "Internal Sever Error",
51 51
             '1002' => "Service Currently Unavailable",
52 52
             '1003' => "Missing Params",
Please login to merge, or discard this patch.
app/Models/Rating/RatingCalculator.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
             $mid = floor(($right + $left)/2);
79 79
             if($this->getSeed($mid) < $rank){
80 80
                 $right = $mid;
81
-            }else{
81
+            } else{
82 82
                 $left = $mid;
83 83
             }
84 84
         }
Please login to merge, or discard this patch.
app/Http/Controllers/Ajax/AccountController.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         if(empty($last_send) || time() - $last_send >= 300){
91 91
             $request->session()->put('last_email_send',time());
92 92
             return ResponseModel::success(200,null,0);
93
-        }else{
93
+        } else{
94 94
             $cooldown =  300 - (time() - $last_send);
95 95
             return ResponseModel::success(200,null,$cooldown);
96 96
         }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         foreach ($input as $key => $value) {
110 110
             if(strlen($value) != 0){
111 111
                 $account_model->setExtra($user_id,$key,$value,0);
112
-            }else{
112
+            } else{
113 113
                 $account_model->setExtra($user_id,$key,null);
114 114
             }
115 115
         }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         foreach ($input as $key => $value) {
130 130
             if(strlen($value) != 0){
131 131
                 $account_model->setExtra($user_id,$key,$value,0);
132
-            }else{
132
+            } else{
133 133
                 $account_model->setExtra($user_id,$key,null);
134 134
             }
135 135
         }
Please login to merge, or discard this patch.
app/Models/AccountModel.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                     }
156 156
                 }
157 157
                 return null;
158
-            }else{
158
+            } else{
159 159
                 foreach ($ret as $value) {
160 160
                     if(empty($value['secret_level']) || $value['secret_level'] <= $secret_level){
161 161
                         $key_name = $this->user_extra[$value['key']] ?? 'unknown';
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
             unset($ret['id']);
188 188
             if(!is_null($value)){
189 189
                 $ret['value'] = $value;
190
-            }else{
190
+            } else{
191 191
                 DB::table('users_extra')->where('uid',$uid)->where('key',$key)->delete();
192 192
                 return true;
193 193
             }
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
                 $ret['secret_level'] = $secret_level;
196 196
             }
197 197
             return DB::table('users_extra')->where('uid',$uid)->where('key',$key)->update($ret);
198
-        }else{
198
+        } else{
199 199
             if($value === null){
200 200
                 return true;
201 201
             }
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         $key = array_search($key,$this->user_extra);
221 221
         if($key){
222 222
             return DB::table('users_extra')->where('key',$key)->where('value',$value)->first();
223
-        }else{
223
+        } else{
224 224
             return null;
225 225
         }
226 226
     }
Please login to merge, or discard this patch.
app/Http/Controllers/ProblemController.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,9 @@
 block discarded – undo
132 132
         }
133 133
 
134 134
         $editor_left_width = $account->getExtra(Auth::user()->id, 'editor_left_width');
135
-        if(empty($editor_left_width)) $editor_left_width='40';
135
+        if(empty($editor_left_width)) {
136
+            $editor_left_width='40';
137
+        }
136 138
 
137 139
         return is_null($prob_detail) ?  redirect("/problem") : view('problem.editor', [
138 140
                                             'page_title'=>$prob_detail["title"],
Please login to merge, or discard this patch.
app/Models/Rating/GroupRatingCalculator.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
             $mid = floor(($right + $left)/2);
79 79
             if($this->getSeed($mid) < $rank){
80 80
                 $right = $mid;
81
-            }else{
81
+            } else{
82 82
                 $left = $mid;
83 83
             }
84 84
         }
Please login to merge, or discard this patch.
app/Models/ContestModel.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -265,7 +265,7 @@
 block discarded – undo
265 265
                             $query=$query->where(["practice"=>$filter['practice']]);
266 266
                         }
267 267
                         $query->where('public', 1)
268
-                              ->where('audit_status', 1);
268
+                                ->where('audit_status', 1);
269 269
                     }
270 270
                 )
271 271
                 ->orWhere(
Please login to merge, or discard this patch.
Braces   +26 added lines, -27 removed lines patch added patch discarded remove patch
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
                     $paginator=$paginator->where(["practice"=>$filter['practice']]);
226 226
                 }
227 227
                 $paginator = $paginator ->paginate(10);
228
-            }elseif($filter['public']=='0'){
228
+            } elseif($filter['public']=='0'){
229 229
                 $paginator=DB::table('group_member')
230 230
                 ->groupBy('contest.cid')
231 231
                 ->select('contest.*')
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
                 )
256 256
                 ->orderBy('contest.begin_time', 'desc')
257 257
                 ->paginate(10);
258
-            }else{
258
+            } else{
259 259
                 $paginator=DB::table('group_member')
260 260
                 ->groupBy('contest.cid')
261 261
                 ->select('contest.*')
@@ -798,13 +798,13 @@  discard block
 block discarded – undo
798 798
         if(time() < $end_time){
799 799
             if($clearance == 3){
800 800
                 $contestRankRaw=Cache::tags(['contest', 'rank'])->get("contestAdmin$cid");
801
-            }else{
801
+            } else{
802 802
                 $contestRankRaw=Cache::tags(['contest', 'rank'])->get($cid);
803 803
             }
804 804
             if(!isset($contestRankRaw)){
805 805
                 $contestRankRaw=$this->contestRankCache($cid);
806 806
             }
807
-        }else{
807
+        } else{
808 808
             if($clearance == 3){
809 809
                 $contestRankRaw=Cache::tags(['contest', 'rank'])->get("contestAdmin$cid");
810 810
                 if (!isset($contestRankRaw)) {
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
                         $this->storeContestRankInMySQL($cid, $contestRankRaw);
815 815
                     }
816 816
                 }
817
-            }else{
817
+            } else{
818 818
                 $contestRankRaw=$this->getContestRankFromMySQL($cid);
819 819
                 if(!isset($contestRankRaw)){
820 820
                     $contestRankRaw=Cache::tags(['contest', 'rank'])->get($cid);
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
             return DB::table("contest_clarification")->where([
900 900
                 "cid"=>$cid
901 901
             ])->orderBy('create_time', 'desc')->get()->all();
902
-        }else{
902
+        } else{
903 903
             return DB::table("contest_clarification")->where([
904 904
                 "cid"=>$cid
905 905
             ])->where(function ($query) {
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
         $filter['pid'] = array_search($filter['ncode'], array_column($problemSet_temp, 'ncode'));
1064 1064
         if($filter['pid']==false){
1065 1065
             $filter['pid'] = null;
1066
-        }else{
1066
+        } else{
1067 1067
             $filter['pid'] = $problemSet_temp[$filter['pid']]['pid'];
1068 1068
         }
1069 1069
 
@@ -1171,7 +1171,7 @@  discard block
 block discarded – undo
1171 1171
                     "records"=>[]
1172 1172
                 ];
1173 1173
             }
1174
-        }else{
1174
+        } else{
1175 1175
             if ($basicInfo["status_visibility"]==2) {
1176 1176
                 // View all
1177 1177
                 $paginator=DB::table("submission")->where([
@@ -1421,7 +1421,7 @@  discard block
 block discarded – undo
1421 1421
             if($ratingCalculator->calculate()){
1422 1422
                 $ratingCalculator->storage();
1423 1423
                 return true;
1424
-            }else{
1424
+            } else{
1425 1425
                 return false;
1426 1426
             }
1427 1427
         } else {
@@ -1470,7 +1470,7 @@  discard block
 block discarded – undo
1470 1470
             $contestRankRaw = $this->contestRankCache($cid);
1471 1471
             Cache::tags(['contest', 'rank'])->put($cid, $contestRankRaw);
1472 1472
             Cache::tags(['contest', 'rank'])->put("contestAdmin$cid", $contestRankRaw);
1473
-        }else{
1473
+        } else{
1474 1474
             DB::table($this->tableName)
1475 1475
                 ->where('cid',$cid)
1476 1476
                 ->update($data);
@@ -1572,8 +1572,7 @@  discard block
 block discarded – undo
1572 1572
                     if(time() > $chache['end_time']){
1573 1573
                         $this->storeContestRankInMySQL($cid, $ret);
1574 1574
                     }
1575
-                }
1576
-                else{
1575
+                } else{
1577 1576
                     $ret=[];
1578 1577
                     $chache=[];
1579 1578
                     $chache['contest_info']=DB::table("contest")->where("cid", $cid)->first();
@@ -1588,7 +1587,7 @@  discard block
 block discarded – undo
1588 1587
                             "cid"=>$cid,
1589 1588
                             "audit"=>1
1590 1589
                         ])->select('uid')->get()->all();
1591
-                    }else{
1590
+                    } else{
1592 1591
                         $submissionUsers=DB::table("submission")->where([
1593 1592
                             "cid"=>$cid
1594 1593
                         ])->where(
@@ -1623,9 +1622,9 @@  discard block
 block discarded – undo
1623 1622
                     Cache::tags(['contest', 'rank'])->put("contestAdmin$cid", $retAdmin);
1624 1623
                 }
1625 1624
             }
1626
-        }catch(LockTimeoutException $e){
1625
+        } catch(LockTimeoutException $e){
1627 1626
             Log::warning("Contest Rank Lock Timed Out");
1628
-        }finally{
1627
+        } finally{
1629 1628
             optional($lock)->release();
1630 1629
         }
1631 1630
     }
@@ -1648,7 +1647,7 @@  discard block
 block discarded – undo
1648 1647
                     return 1;
1649 1648
                 }
1650 1649
             });
1651
-        }else if ($contest_info["rule"]==2){
1650
+        } else if ($contest_info["rule"]==2){
1652 1651
             usort($ret, function ($a, $b) {
1653 1652
                 if ($a["score"]==$b["score"]) {
1654 1653
                     if ($a["solved"]==$b["solved"]) {
@@ -1672,8 +1671,9 @@  discard block
 block discarded – undo
1672 1671
     {
1673 1672
         $id = count($ret);
1674 1673
         foreach($ret as $key => $r){
1675
-            if($r['uid'] == $uid)
1676
-                $id = $key;
1674
+            if($r['uid'] == $uid) {
1675
+                            $id = $key;
1676
+            }
1677 1677
         }
1678 1678
         if ($contest_info["rule"]==1) {
1679 1679
             // ACM/ICPC Mode
@@ -1681,7 +1681,7 @@  discard block
 block discarded – undo
1681 1681
                 $prob_detail = [];
1682 1682
                 $totPen = 0;
1683 1683
                 $totScore = 0;
1684
-            }else{
1684
+            } else{
1685 1685
                 $prob_detail = $ret[$id]['problem_detail'];
1686 1686
                 $totPen=$ret[$id]['penalty'];
1687 1687
                 $totScore=$ret[$id]['score'];
@@ -1736,7 +1736,7 @@  discard block
 block discarded – undo
1736 1736
                 $prob_detail = [];
1737 1737
                 $totSolved = 0;
1738 1738
                 $totScore = 0;
1739
-            }else{
1739
+            } else{
1740 1740
                 $prob_detail = $ret[$id]['problem_detail'];
1741 1741
                 $totSolved=$ret[$id]['solved'];
1742 1742
                 $totScore=$ret[$id]['score'];
@@ -1799,18 +1799,18 @@  discard block
 block discarded – undo
1799 1799
                 return false;
1800 1800
             }
1801 1801
             return true;
1802
-        }else if($status === 0){
1802
+        } else if($status === 0){
1803 1803
             if($begin_time_new !== null){
1804 1804
                 return false;
1805 1805
             }
1806 1806
             if($end_time_new !== null){
1807 1807
                 if(strtotime($end_time_new) <= time()){
1808 1808
                     return false;
1809
-                }else{
1809
+                } else{
1810 1810
                     return true;
1811 1811
                 }
1812 1812
             }
1813
-        }else{
1813
+        } else{
1814 1814
             return false;
1815 1815
         }
1816 1816
 
@@ -1831,8 +1831,7 @@  discard block
 block discarded – undo
1831 1831
             return DB::table("contest_clarification")->where('ccid','=',$ccid)->update([
1832 1832
                 "public"=>1
1833 1833
             ]);
1834
-        }
1835
-        else
1834
+        } else
1836 1835
         {
1837 1836
             return DB::table("contest_clarification")->where('ccid','=',$ccid)->update([
1838 1837
                 "public"=>0
@@ -1855,7 +1854,7 @@  discard block
 block discarded – undo
1855 1854
             ->whereIn('pid',array_column($contestRank[0]['problem_detail'],'pid'))
1856 1855
             ->select('pid','title')
1857 1856
             ->get()->all();
1858
-        }else{
1857
+        } else{
1859 1858
             $all_problems = [];
1860 1859
         }
1861 1860
         $tags = DB::table('group_problem_tag')
@@ -1920,7 +1919,7 @@  discard block
 block discarded – undo
1920 1919
             return [
1921 1920
                 'result' => true
1922 1921
             ];
1923
-        }else{
1922
+        } else{
1924 1923
             return [
1925 1924
                 'result' => false,
1926 1925
                 'sid' => $submissions
Please login to merge, or discard this patch.
app/Exports/GroupAnalysisExport.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
     }
29 29
 
30 30
     /**
31
-    * @return array
32
-    */
31
+     * @return array
32
+     */
33 33
     public function registerEvents(): array
34 34
     {
35 35
         return [
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
     }
47 47
 
48 48
     /**
49
-    * @return \Illuminate\Support\Collection
50
-    */
49
+     * @return \Illuminate\Support\Collection
50
+     */
51 51
     public function collection()
52 52
     {
53 53
         $maxium = $this->config['maxium'] ?? false;
Please login to merge, or discard this patch.