Passed
Pull Request — master (#250)
by
unknown
04:11
created
app/Models/Update/UpdateModel.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
                 "name"=>$versionInfo[0]["name"],
25 25
                 "updatable"=>$updatable
26 26
             ];
27
-        }catch(Throwable $e){
27
+        } catch(Throwable $e){
28 28
             return null;
29 29
         }
30 30
     }
Please login to merge, or discard this patch.
app/Babel/Install/InstallerBase.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
             //writing database
39 39
             $this->transactionDB();
40 40
 
41
-        }catch(Throwable $e){
41
+        } catch(Throwable $e){
42 42
             if ($e->getMessage()!==""){
43 43
                 $this->command->line("\n  <bg=red;fg=white> {$e->getMessage()} </>\n");
44 44
             }
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 
221 221
             DB::commit();
222 222
 
223
-        }catch(Throwable $e){
223
+        } catch(Throwable $e){
224 224
             DB::rollback();
225 225
             if ($e->getMessage()!=="") {
226 226
                 $this->command->line("\n  <bg=red;fg=white> {$e->getMessage()} </>\n");
Please login to merge, or discard this patch.
app/Http/Controllers/Ajax/ContestAdminController.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         }
61 61
         if($assign_uid != 0){
62 62
             $assignee = $groupModel->userProfile($assign_uid,$contest_detail['gid']);
63
-        }else{
63
+        } else{
64 64
             $assignee = null;
65 65
         }
66 66
         $ret = [
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
             }
221 221
             $contestModel->contestUpdate($cid,$all_data,$problemSet);
222 222
             return ResponseModel::success(200);
223
-        }else{
223
+        } else{
224 224
             $allow_update = ['name','description'];
225 225
 
226 226
             foreach($all_data as $key => $value){
Please login to merge, or discard this patch.
app/Http/Controllers/Contest/AdminController.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
         $account=$contestModel->getContestAccount($cid);
59 59
         if($account==null){
60 60
             return ;
61
-        }else{
61
+        } else{
62 62
             $AccountExport=new AccountExport($account);
63 63
             $filename="ContestAccount$cid";
64 64
             return Excel::download($AccountExport, $filename.'.xlsx');
Please login to merge, or discard this patch.
app/Http/Controllers/Group/AdminController.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,9 @@  discard block
 block discarded – undo
43 43
     {
44 44
         $groupModel=new GroupModel();
45 45
         $basic_info=$groupModel->details($gcode);
46
-        if(empty($basic_info)) return Redirect::route('group.index');
46
+        if(empty($basic_info)) {
47
+            return Redirect::route('group.index');
48
+        }
47 49
         $clearance=$groupModel->judgeClearance($basic_info["gid"], Auth::user()->id);
48 50
         $member_list=$groupModel->userList($basic_info["gid"]);
49 51
         return view('group.settings.general', [
@@ -85,7 +87,9 @@  discard block
 block discarded – undo
85 87
     {
86 88
         $groupModel=new GroupModel();
87 89
         $basic_info=$groupModel->details($gcode);
88
-        if(empty($basic_info)) return Redirect::route('group.index');
90
+        if(empty($basic_info)) {
91
+            return Redirect::route('group.index');
92
+        }
89 93
         return view('group.settings.danger', [
90 94
             'page_title'=>"Group Setting danger",
91 95
             'site_title'=>config("app.name"),
@@ -104,7 +108,9 @@  discard block
 block discarded – undo
104 108
         $groupModel=new GroupModel();
105 109
         $contestModel=new ContestModel();
106 110
         $basic_info=$groupModel->details($gcode);
107
-        if(empty($basic_info)) return Redirect::route('group.index');
111
+        if(empty($basic_info)) {
112
+            return Redirect::route('group.index');
113
+        }
108 114
         $clearance=$groupModel->judgeClearance($basic_info["gid"], Auth::user()->id);
109 115
         $member_list=$groupModel->userList($basic_info["gid"]);
110 116
         $group_notice=$groupModel->detailNotice($gcode);
@@ -124,7 +130,9 @@  discard block
 block discarded – undo
124 130
         $groupModel=new GroupModel();
125 131
         $contestModel=new ContestModel();
126 132
         $basic_info=$groupModel->details($gcode);
127
-        if(empty($basic_info)) return Redirect::route('group.index');
133
+        if(empty($basic_info)) {
134
+            return Redirect::route('group.index');
135
+        }
128 136
         $clearance=$groupModel->judgeClearance($basic_info["gid"], Auth::user()->id);
129 137
         $contest_list=$contestModel->listForSetting($basic_info["gid"]);
130 138
         $member_list=$groupModel->userList($basic_info["gid"]);
Please login to merge, or discard this patch.
app/Http/Controllers/Ajax/GroupManageController.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -244,11 +244,17 @@
 block discarded – undo
244 244
 
245 245
         $groupModel=new GroupModel();
246 246
         $is_user=$groupModel->isUser($all_data["email"]);
247
-        if(!$is_user) return ResponseModel::err(2006);
247
+        if(!$is_user) {
248
+            return ResponseModel::err(2006);
249
+        }
248 250
         $clearance=$groupModel->judgeClearance($all_data["gid"], Auth::user()->id);
249
-        if($clearance<2) return ResponseModel::err(7002);
251
+        if($clearance<2) {
252
+            return ResponseModel::err(7002);
253
+        }
250 254
         $targetClearance=$groupModel->judgeEmailClearance($all_data["gid"], $all_data["email"]);
251
-        if($targetClearance!=-3) return ResponseModel::err(7003);
255
+        if($targetClearance!=-3) {
256
+            return ResponseModel::err(7003);
257
+        }
252 258
         $groupModel->inviteMember($all_data["gid"], $all_data["email"]);
253 259
         return ResponseModel::success(200);
254 260
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Ajax/GroupController.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,9 +69,13 @@
 block discarded – undo
69 69
         $all_data=$request->all();
70 70
 
71 71
         $groupModel=new GroupModel();
72
-        if($all_data["gcode"]=="create") return ResponseModel::err(7005);
72
+        if($all_data["gcode"]=="create") {
73
+            return ResponseModel::err(7005);
74
+        }
73 75
         $is_group=$groupModel->isGroup($all_data["gcode"]);
74
-        if($is_group) return ResponseModel::err(7006);
76
+        if($is_group) {
77
+            return ResponseModel::err(7006);
78
+        }
75 79
 
76 80
         $allow_extension=['jpg', 'png', 'jpeg', 'gif', 'bmp'];
77 81
         if (!empty($request->file('img')) && $request->file('img')->isValid()) {
Please login to merge, or discard this patch.
app/Models/ProblemModel.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -430,7 +430,9 @@  discard block
 block discarded – undo
430 430
 
431 431
         if (!empty($data["sample"])) {
432 432
             foreach ($data["sample"] as $d) {
433
-                if(!isset($d['sample_note'])) $d['sample_note']=null;
433
+                if(!isset($d['sample_note'])) {
434
+                    $d['sample_note']=null;
435
+                }
434 436
                 DB::table("problem_sample")->insert([
435 437
                     'pid'=>$pid,
436 438
                     'sample_input'=>$d['sample_input'],
@@ -476,7 +478,9 @@  discard block
 block discarded – undo
476 478
 
477 479
         if (!empty($data["sample"])) {
478 480
             foreach ($data["sample"] as $d) {
479
-                if(!isset($d['sample_note'])) $d['sample_note']=null;
481
+                if(!isset($d['sample_note'])) {
482
+                    $d['sample_note']=null;
483
+                }
480 484
                 DB::table("problem_sample")->insert([
481 485
                     'pid'=>$pid,
482 486
                     'sample_input'=>$d['sample_input'],
Please login to merge, or discard this patch.
app/Http/Controllers/Contest/BoardController.php 1 patch
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -107,7 +107,9 @@  discard block
 block discarded – undo
107 107
         }
108 108
 
109 109
         $editor_left_width = $accountModel->getExtra(Auth::user()->id, 'editor_left_width');
110
-        if(empty($editor_left_width)) $editor_left_width='40';
110
+        if(empty($editor_left_width)) {
111
+            $editor_left_width='40';
112
+        }
111 113
 
112 114
         return view('contest.board.editor', [
113 115
             'page_title'=>"Problem Detail",
@@ -154,10 +156,10 @@  discard block
 block discarded – undo
154 156
             if($i != 0) {
155 157
                 if($r['score'] == $contestRank[$i-1]['score'] && $r['penalty'] == $contestRank[$i-1]['penalty']){
156 158
                     $r['rank'] = $contestRank[$i-1]['rank'];
157
-                }else{
159
+                } else{
158 160
                     $r['rank'] = $i + 1;
159 161
                 }
160
-            }else{
162
+            } else{
161 163
                 $r['rank'] = 1;
162 164
             }
163 165
         }
Please login to merge, or discard this patch.