Passed
Branch dev (b46dca)
by John
04:11
created
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/Http/Controllers/OAuth/GithubController.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     {
43 43
         try{
44 44
             $github_user = Socialite::driver('github')->user();
45
-        }catch(\Laravel\Socialite\Two\InvalidStateException $e){
45
+        } catch(\Laravel\Socialite\Two\InvalidStateException $e){
46 46
             return redirect('/');
47 47
         }
48 48
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                     ],
87 87
                 ]
88 88
             ]);
89
-        }else{
89
+        } else{
90 90
             $ret = $accountModel->findExtra('github_id',$github_user->id);
91 91
             if(!empty($ret)){
92 92
                 Auth::loginUsingId($ret['uid']);
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                 $accountModel->setExtra($user_id,'github_homepage',($github_user->user)['html_url']);
97 97
                 $accountModel->setExtra($user_id,'github_token',$github_user->token,101);
98 98
                 return redirect('/');
99
-            }else{
99
+            } else{
100 100
                 return view('oauth.index',[
101 101
                     'page_title'=>"OAuth",
102 102
                     'site_title'=>config("app.name"),
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
                     ],
144 144
                 ]
145 145
             ]);
146
-        }else{
146
+        } else{
147 147
             return view('oauth.index',[
148 148
                 'page_title'=>"OAuth",
149 149
                 'site_title'=>config("app.name"),
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                     ],
184 184
                 ]
185 185
             ]);
186
-        }else{
186
+        } else{
187 187
             return view('oauth.index',[
188 188
                 'page_title'=>"OAuth",
189 189
                 'site_title'=>config("app.name"),
Please login to merge, or discard this patch.
app/Http/Controllers/Ajax/GroupController.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -301,11 +301,17 @@  discard block
 block discarded – undo
301 301
 
302 302
         $groupModel=new GroupModel();
303 303
         $is_user=$groupModel->isUser($all_data["email"]);
304
-        if(!$is_user) return ResponseModel::err(2006);
304
+        if(!$is_user) {
305
+            return ResponseModel::err(2006);
306
+        }
305 307
         $clearance=$groupModel->judgeClearance($all_data["gid"], Auth::user()->id);
306
-        if($clearance<2) return ResponseModel::err(7002);
308
+        if($clearance<2) {
309
+            return ResponseModel::err(7002);
310
+        }
307 311
         $targetClearance=$groupModel->judgeEmailClearance($all_data["gid"], $all_data["email"]);
308
-        if($targetClearance!=-3) return ResponseModel::err(7003);
312
+        if($targetClearance!=-3) {
313
+            return ResponseModel::err(7003);
314
+        }
309 315
         $groupModel->inviteMember($all_data["gid"], $all_data["email"]);
310 316
         return ResponseModel::success(200);
311 317
     }
@@ -323,9 +329,13 @@  discard block
 block discarded – undo
323 329
         $all_data=$request->all();
324 330
 
325 331
         $groupModel=new GroupModel();
326
-        if($all_data["gcode"]=="create") return ResponseModel::err(7005);
332
+        if($all_data["gcode"]=="create") {
333
+            return ResponseModel::err(7005);
334
+        }
327 335
         $is_group=$groupModel->isGroup($all_data["gcode"]);
328
-        if($is_group) return ResponseModel::err(7006);
336
+        if($is_group) {
337
+            return ResponseModel::err(7006);
338
+        }
329 339
 
330 340
         $allow_extension=['jpg', 'png', 'jpeg', 'gif', 'bmp'];
331 341
         if (!empty($request->file('img')) && $request->file('img')->isValid()) {
Please login to merge, or discard this patch.
app/Http/Controllers/ContestController.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -187,7 +187,9 @@  discard block
 block discarded – undo
187 187
         }
188 188
 
189 189
         $editor_left_width = $accountModel->getExtra(Auth::user()->id, 'editor_left_width');
190
-        if(empty($editor_left_width)) $editor_left_width='40';
190
+        if(empty($editor_left_width)) {
191
+            $editor_left_width='40';
192
+        }
191 193
 
192 194
         return view('contest.board.editor', [
193 195
             'page_title'=>"Problem Detail",
@@ -383,7 +385,7 @@  discard block
 block discarded – undo
383 385
         $account=$contestModel->getContestAccount($cid);
384 386
         if($account==null){
385 387
             return ;
386
-        }else{
388
+        } else{
387 389
             $AccountExport=new AccountExport($account);
388 390
             $filename="ContestAccount$cid";
389 391
             return Excel::download($AccountExport, $filename.'.xlsx');
Please login to merge, or discard this patch.
app/Http/Middleware/Privileged.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
                 if($groupModel->judgeClearance($groupModel->gid($request->gcode), Auth::user()->id)>=2){
25 25
                     return $next($request);
26 26
                 }
27
-            }elseif(isset($request->cid)) {
27
+            } elseif(isset($request->cid)) {
28 28
                 //contest privilege
29 29
                 $contestModel=new ContestModel();
30 30
                 if($contestModel->judgeClearance($request->cid, Auth::user()->id)==3){
Please login to merge, or discard this patch.