Completed
Push — master ( c106d2...7c3edb )
by John
14s queued 10s
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 2 patches
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.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -150,10 +150,10 @@
 block discarded – undo
150 150
     }
151 151
 
152 152
         /**
153
-     * Show the Problem Discussion Page.
154
-     *
155
-     * @return Response
156
-     */
153
+         * Show the Problem Discussion Page.
154
+         *
155
+         * @return Response
156
+         */
157 157
     public function discussion($pcode)
158 158
     {
159 159
         //TODO
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
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
                     $paginator=$paginator->where(["practice"=>$filter['practice']]);
228 228
                 }
229 229
                 $paginator = $paginator ->paginate(10);
230
-            }elseif($filter['public']=='0'){
230
+            } elseif($filter['public']=='0'){
231 231
                 $paginator=DB::table('group_member')
232 232
                 ->groupBy('contest.cid')
233 233
                 ->select('contest.*')
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
                 )
258 258
                 ->orderBy('contest.begin_time', 'desc')
259 259
                 ->paginate(10);
260
-            }else{
260
+            } else{
261 261
                 $paginator=DB::table('group_member')
262 262
                 ->groupBy('contest.cid')
263 263
                 ->select('contest.*')
@@ -809,13 +809,13 @@  discard block
 block discarded – undo
809 809
         if(time() < $end_time){
810 810
             if($clearance == 3){
811 811
                 $contestRankRaw=Cache::tags(['contest', 'rank'])->get("contestAdmin$cid");
812
-            }else{
812
+            } else{
813 813
                 $contestRankRaw=Cache::tags(['contest', 'rank'])->get($cid);
814 814
             }
815 815
             if(!isset($contestRankRaw)){
816 816
                 $contestRankRaw=$contest_eloquent->rankRefresh();
817 817
             }
818
-        }else{
818
+        } else{
819 819
             if($clearance == 3){
820 820
                 $contestRankRaw=Cache::tags(['contest', 'rank'])->get("contestAdmin$cid");
821 821
                 if (!isset($contestRankRaw)) {
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
                         $this->storeContestRankInMySQL($cid, $contestRankRaw);
826 826
                     }
827 827
                 }
828
-            }else{
828
+            } else{
829 829
                 $contestRankRaw=$this->getContestRankFromMySQL($cid);
830 830
                 if(!isset($contestRankRaw)){
831 831
                     $contestRankRaw=Cache::tags(['contest', 'rank'])->get($cid);
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
             return DB::table("contest_clarification")->where([
911 911
                 "cid"=>$cid
912 912
             ])->orderBy('create_time', 'desc')->get()->all();
913
-        }else{
913
+        } else{
914 914
             return DB::table("contest_clarification")->where([
915 915
                 "cid"=>$cid
916 916
             ])->where(function ($query) {
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
         $filter['pid'] = array_search($filter['ncode'], array_column($problemSet_temp, 'ncode'));
1076 1076
         if($filter['pid']==false){
1077 1077
             $filter['pid'] = null;
1078
-        }else{
1078
+        } else{
1079 1079
             $filter['pid'] = $problemSet_temp[$filter['pid']]['pid'];
1080 1080
         }
1081 1081
 
@@ -1183,7 +1183,7 @@  discard block
 block discarded – undo
1183 1183
                     "records"=>[]
1184 1184
                 ];
1185 1185
             }
1186
-        }else{
1186
+        } else{
1187 1187
             if ($basicInfo["status_visibility"]==2) {
1188 1188
                 // View all
1189 1189
                 $paginator=DB::table("submission")->where([
@@ -1433,7 +1433,7 @@  discard block
 block discarded – undo
1433 1433
             if($ratingCalculator->calculate()){
1434 1434
                 $ratingCalculator->storage();
1435 1435
                 return true;
1436
-            }else{
1436
+            } else{
1437 1437
                 return false;
1438 1438
             }
1439 1439
         } else {
@@ -1482,7 +1482,7 @@  discard block
 block discarded – undo
1482 1482
             $contestRankRaw = $this->contestRankCache($cid);
1483 1483
             Cache::tags(['contest', 'rank'])->put($cid, $contestRankRaw);
1484 1484
             Cache::tags(['contest', 'rank'])->put("contestAdmin$cid", $contestRankRaw);
1485
-        }else{
1485
+        } else{
1486 1486
             DB::table($this->tableName)
1487 1487
                 ->where('cid',$cid)
1488 1488
                 ->update($data);
@@ -1584,8 +1584,7 @@  discard block
 block discarded – undo
1584 1584
                     if(time() > $chache['end_time']){
1585 1585
                         $this->storeContestRankInMySQL($cid, $ret);
1586 1586
                     }
1587
-                }
1588
-                else{
1587
+                } else{
1589 1588
                     $ret=[];
1590 1589
                     $chache=[];
1591 1590
                     $chache['contest_info']=DB::table("contest")->where("cid", $cid)->first();
@@ -1600,7 +1599,7 @@  discard block
 block discarded – undo
1600 1599
                             "cid"=>$cid,
1601 1600
                             "audit"=>1
1602 1601
                         ])->select('uid')->get()->all();
1603
-                    }else{
1602
+                    } else{
1604 1603
                         $submissionUsers=DB::table("submission")->where([
1605 1604
                             "cid"=>$cid
1606 1605
                         ])->where(
@@ -1635,9 +1634,9 @@  discard block
 block discarded – undo
1635 1634
                     Cache::tags(['contest', 'rank'])->put("contestAdmin$cid", $retAdmin);
1636 1635
                 }
1637 1636
             }
1638
-        }catch(LockTimeoutException $e){
1637
+        } catch(LockTimeoutException $e){
1639 1638
             Log::warning("Contest Rank Lock Timed Out");
1640
-        }finally{
1639
+        } finally{
1641 1640
             optional($lock)->release();
1642 1641
         }
1643 1642
     }
@@ -1660,7 +1659,7 @@  discard block
 block discarded – undo
1660 1659
                     return 1;
1661 1660
                 }
1662 1661
             });
1663
-        }else if ($contest_info["rule"]==2){
1662
+        } else if ($contest_info["rule"]==2){
1664 1663
             usort($ret, function ($a, $b) {
1665 1664
                 if ($a["score"]==$b["score"]) {
1666 1665
                     if ($a["solved"]==$b["solved"]) {
@@ -1684,8 +1683,9 @@  discard block
 block discarded – undo
1684 1683
     {
1685 1684
         $id = count($ret);
1686 1685
         foreach($ret as $key => $r){
1687
-            if($r['uid'] == $uid)
1688
-                $id = $key;
1686
+            if($r['uid'] == $uid) {
1687
+                            $id = $key;
1688
+            }
1689 1689
         }
1690 1690
         if ($contest_info["rule"]==1) {
1691 1691
             // ACM/ICPC Mode
@@ -1693,7 +1693,7 @@  discard block
 block discarded – undo
1693 1693
                 $prob_detail = [];
1694 1694
                 $totPen = 0;
1695 1695
                 $totScore = 0;
1696
-            }else{
1696
+            } else{
1697 1697
                 $prob_detail = $ret[$id]['problem_detail'];
1698 1698
                 $totPen=$ret[$id]['penalty'];
1699 1699
                 $totScore=$ret[$id]['score'];
@@ -1748,7 +1748,7 @@  discard block
 block discarded – undo
1748 1748
                 $prob_detail = [];
1749 1749
                 $totSolved = 0;
1750 1750
                 $totScore = 0;
1751
-            }else{
1751
+            } else{
1752 1752
                 $prob_detail = $ret[$id]['problem_detail'];
1753 1753
                 $totSolved=$ret[$id]['solved'];
1754 1754
                 $totScore=$ret[$id]['score'];
@@ -1811,18 +1811,18 @@  discard block
 block discarded – undo
1811 1811
                 return false;
1812 1812
             }
1813 1813
             return true;
1814
-        }else if($status === 0){
1814
+        } else if($status === 0){
1815 1815
             if($begin_time_new !== null){
1816 1816
                 return false;
1817 1817
             }
1818 1818
             if($end_time_new !== null){
1819 1819
                 if(strtotime($end_time_new) <= time()){
1820 1820
                     return false;
1821
-                }else{
1821
+                } else{
1822 1822
                     return true;
1823 1823
                 }
1824 1824
             }
1825
-        }else{
1825
+        } else{
1826 1826
             return false;
1827 1827
         }
1828 1828
 
@@ -1843,8 +1843,7 @@  discard block
 block discarded – undo
1843 1843
             return DB::table("contest_clarification")->where('ccid','=',$ccid)->update([
1844 1844
                 "public"=>1
1845 1845
             ]);
1846
-        }
1847
-        else
1846
+        } else
1848 1847
         {
1849 1848
             return DB::table("contest_clarification")->where('ccid','=',$ccid)->update([
1850 1849
                 "public"=>0
@@ -1868,7 +1867,7 @@  discard block
 block discarded – undo
1868 1867
             ->whereIn('pid',array_column($contestRank[0]['problem_detail'],'pid'))
1869 1868
             ->select('pid','title')
1870 1869
             ->get()->all();
1871
-        }else{
1870
+        } else{
1872 1871
             $all_problems = [];
1873 1872
         }
1874 1873
         $tags = DB::table('group_problem_tag')
@@ -1963,7 +1962,7 @@  discard block
 block discarded – undo
1963 1962
             return [
1964 1963
                 'result' => true
1965 1964
             ];
1966
-        }else{
1965
+        } else{
1967 1966
             return [
1968 1967
                 'result' => false,
1969 1968
                 '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.