Passed
Branch dev (f02210)
by John
04:13
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   +25 added lines, -26 removed lines patch added patch discarded remove patch
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
                     $paginator=$paginator->where(["practice"=>$filter['practice']]);
225 225
                 }
226 226
                 $paginator = $paginator ->paginate(10);
227
-            }elseif($filter['public']=='0'){
227
+            } elseif($filter['public']=='0'){
228 228
                 $paginator=DB::table('group_member')
229 229
                 ->groupBy('contest.cid')
230 230
                 ->select('contest.*')
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
                 )
255 255
                 ->orderBy('contest.begin_time', 'desc')
256 256
                 ->paginate(10);
257
-            }else{
257
+            } else{
258 258
                 $paginator=DB::table('group_member')
259 259
                 ->groupBy('contest.cid')
260 260
                 ->select('contest.*')
@@ -797,13 +797,13 @@  discard block
 block discarded – undo
797 797
         if(time() < $end_time){
798 798
             if($clearance == 3){
799 799
                 $contestRankRaw=Cache::tags(['contest', 'rank'])->get("contestAdmin$cid");
800
-            }else{
800
+            } else{
801 801
                 $contestRankRaw=Cache::tags(['contest', 'rank'])->get($cid);
802 802
             }
803 803
             if(!isset($contestRankRaw)){
804 804
                 $contestRankRaw=$this->contestRankCache($cid);
805 805
             }
806
-        }else{
806
+        } else{
807 807
             if($clearance == 3){
808 808
                 $contestRankRaw=Cache::tags(['contest', 'rank'])->get("contestAdmin$cid");
809 809
                 if (!isset($contestRankRaw)) {
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
                         $this->storeContestRankInMySQL($cid, $contestRankRaw);
814 814
                     }
815 815
                 }
816
-            }else{
816
+            } else{
817 817
                 $contestRankRaw=$this->getContestRankFromMySQL($cid);
818 818
                 if(!isset($contestRankRaw)){
819 819
                     $contestRankRaw=Cache::tags(['contest', 'rank'])->get($cid);
@@ -898,7 +898,7 @@  discard block
 block discarded – undo
898 898
             return DB::table("contest_clarification")->where([
899 899
                 "cid"=>$cid
900 900
             ])->orderBy('create_time', 'desc')->get()->all();
901
-        }else{
901
+        } else{
902 902
             return DB::table("contest_clarification")->where([
903 903
                 "cid"=>$cid
904 904
             ])->where(function ($query) {
@@ -1062,7 +1062,7 @@  discard block
 block discarded – undo
1062 1062
         $filter['pid'] = array_search($filter['ncode'], array_column($problemSet_temp, 'ncode'));
1063 1063
         if($filter['pid']==false){
1064 1064
             $filter['pid'] = null;
1065
-        }else{
1065
+        } else{
1066 1066
             $filter['pid'] = $problemSet_temp[$filter['pid']]['pid'];
1067 1067
         }
1068 1068
 
@@ -1170,7 +1170,7 @@  discard block
 block discarded – undo
1170 1170
                     "records"=>[]
1171 1171
                 ];
1172 1172
             }
1173
-        }else{
1173
+        } else{
1174 1174
             if ($basicInfo["status_visibility"]==2) {
1175 1175
                 // View all
1176 1176
                 $paginator=DB::table("submission")->where([
@@ -1420,7 +1420,7 @@  discard block
 block discarded – undo
1420 1420
             if($ratingCalculator->calculate()){
1421 1421
                 $ratingCalculator->storage();
1422 1422
                 return true;
1423
-            }else{
1423
+            } else{
1424 1424
                 return false;
1425 1425
             }
1426 1426
         } else {
@@ -1469,7 +1469,7 @@  discard block
 block discarded – undo
1469 1469
             $contestRankRaw = $this->contestRankCache($cid);
1470 1470
             Cache::tags(['contest', 'rank'])->put($cid, $contestRankRaw);
1471 1471
             Cache::tags(['contest', 'rank'])->put("contestAdmin$cid", $contestRankRaw);
1472
-        }else{
1472
+        } else{
1473 1473
             DB::table($this->tableName)
1474 1474
                 ->where('cid',$cid)
1475 1475
                 ->update($data);
@@ -1569,8 +1569,7 @@  discard block
 block discarded – undo
1569 1569
                     if(time() > $chache['end_time']){
1570 1570
                         $this->storeContestRankInMySQL($cid, $ret);
1571 1571
                     }
1572
-                }
1573
-                else{
1572
+                } else{
1574 1573
                     $ret=[];
1575 1574
                     $chache=[];
1576 1575
                     $chache['contest_info']=DB::table("contest")->where("cid", $cid)->first();
@@ -1585,7 +1584,7 @@  discard block
 block discarded – undo
1585 1584
                             "cid"=>$cid,
1586 1585
                             "audit"=>1
1587 1586
                         ])->select('uid')->get()->all();
1588
-                    }else{
1587
+                    } else{
1589 1588
                         $submissionUsers=DB::table("submission")->where([
1590 1589
                             "cid"=>$cid
1591 1590
                         ])->where(
@@ -1620,9 +1619,9 @@  discard block
 block discarded – undo
1620 1619
                     Cache::tags(['contest', 'rank'])->put("contestAdmin$cid", $retAdmin);
1621 1620
                 }
1622 1621
             }
1623
-        }catch(LockTimeoutException $e){
1622
+        } catch(LockTimeoutException $e){
1624 1623
             Log::warning("Contest Rank Lock Timed Out");
1625
-        }finally{
1624
+        } finally{
1626 1625
             optional($lock)->release();
1627 1626
         }
1628 1627
     }
@@ -1645,7 +1644,7 @@  discard block
 block discarded – undo
1645 1644
                     return 1;
1646 1645
                 }
1647 1646
             });
1648
-        }else if ($contest_info["rule"]==2){
1647
+        } else if ($contest_info["rule"]==2){
1649 1648
             usort($ret, function ($a, $b) {
1650 1649
                 if ($a["score"]==$b["score"]) {
1651 1650
                     if ($a["solved"]==$b["solved"]) {
@@ -1669,8 +1668,9 @@  discard block
 block discarded – undo
1669 1668
     {
1670 1669
         $id = count($ret);
1671 1670
         foreach($ret as $key => $r){
1672
-            if($r['uid'] == $uid)
1673
-                $id = $key;
1671
+            if($r['uid'] == $uid) {
1672
+                            $id = $key;
1673
+            }
1674 1674
         }
1675 1675
         if ($contest_info["rule"]==1) {
1676 1676
             // ACM/ICPC Mode
@@ -1678,7 +1678,7 @@  discard block
 block discarded – undo
1678 1678
                 $prob_detail = [];
1679 1679
                 $totPen = 0;
1680 1680
                 $totScore = 0;
1681
-            }else{
1681
+            } else{
1682 1682
                 $prob_detail = $ret[$id]['problem_detail'];
1683 1683
                 $totPen=$ret[$id]['penalty'];
1684 1684
                 $totScore=$ret[$id]['score'];
@@ -1733,7 +1733,7 @@  discard block
 block discarded – undo
1733 1733
                 $prob_detail = [];
1734 1734
                 $totSolved = 0;
1735 1735
                 $totScore = 0;
1736
-            }else{
1736
+            } else{
1737 1737
                 $prob_detail = $ret[$id]['problem_detail'];
1738 1738
                 $totSolved=$ret[$id]['solved'];
1739 1739
                 $totScore=$ret[$id]['score'];
@@ -1796,18 +1796,18 @@  discard block
 block discarded – undo
1796 1796
                 return false;
1797 1797
             }
1798 1798
             return true;
1799
-        }else if($status === 0){
1799
+        } else if($status === 0){
1800 1800
             if($begin_time_new !== null){
1801 1801
                 return false;
1802 1802
             }
1803 1803
             if($end_time_new !== null){
1804 1804
                 if(strtotime($end_time_new) <= time()){
1805 1805
                     return false;
1806
-                }else{
1806
+                } else{
1807 1807
                     return true;
1808 1808
                 }
1809 1809
             }
1810
-        }else{
1810
+        } else{
1811 1811
             return false;
1812 1812
         }
1813 1813
 
@@ -1828,8 +1828,7 @@  discard block
 block discarded – undo
1828 1828
             return DB::table("contest_clarification")->where('ccid','=',$ccid)->update([
1829 1829
                 "public"=>1
1830 1830
             ]);
1831
-        }
1832
-        else
1831
+        } else
1833 1832
         {
1834 1833
             return DB::table("contest_clarification")->where('ccid','=',$ccid)->update([
1835 1834
                 "public"=>0
@@ -1852,7 +1851,7 @@  discard block
 block discarded – undo
1852 1851
             ->whereIn('pid',array_column($contestRank[0]['problem_detail'],'pid'))
1853 1852
             ->select('pid','title')
1854 1853
             ->get()->all();
1855
-        }else{
1854
+        } else{
1856 1855
             $all_problems = [];
1857 1856
         }
1858 1857
         $tags = DB::table('group_problem_tag')
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.