@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
| 38 | 38 | if($clearance == 3){ |
| 39 | 39 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 40 | - }else{ |
|
| 40 | + } else{ |
|
| 41 | 41 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
| 84 | 84 | if($clearance == 3){ |
| 85 | 85 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 86 | - }else{ |
|
| 86 | + } else{ |
|
| 87 | 87 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -116,7 +116,9 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $editor_left_width = $accountModel->getExtra(Auth::user()->id, 'editor_left_width'); |
| 119 | - if(empty($editor_left_width)) $editor_left_width='40'; |
|
| 119 | + if(empty($editor_left_width)) { |
|
| 120 | + $editor_left_width='40'; |
|
| 121 | + } |
|
| 120 | 122 | |
| 121 | 123 | return view('contest.board.editor', [ |
| 122 | 124 | 'page_title'=>"Problem Detail", |
@@ -153,7 +155,7 @@ discard block |
||
| 153 | 155 | if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
| 154 | 156 | if($clearance == 3){ |
| 155 | 157 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 156 | - }else{ |
|
| 158 | + } else{ |
|
| 157 | 159 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 158 | 160 | } |
| 159 | 161 | } |
@@ -168,10 +170,10 @@ discard block |
||
| 168 | 170 | if($i != 0) { |
| 169 | 171 | if($r['score'] == $contestRank[$i-1]['score'] && $r['penalty'] == $contestRank[$i-1]['penalty']){ |
| 170 | 172 | $r['rank'] = $contestRank[$i-1]['rank']; |
| 171 | - }else{ |
|
| 173 | + } else{ |
|
| 172 | 174 | $r['rank'] = $i + 1; |
| 173 | 175 | } |
| 174 | - }else{ |
|
| 176 | + } else{ |
|
| 175 | 177 | $r['rank'] = 1; |
| 176 | 178 | } |
| 177 | 179 | } |
@@ -212,7 +214,7 @@ discard block |
||
| 212 | 214 | if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
| 213 | 215 | if($clearance == 3){ |
| 214 | 216 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 215 | - }else{ |
|
| 217 | + } else{ |
|
| 216 | 218 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 217 | 219 | } |
| 218 | 220 | } |
@@ -250,7 +252,7 @@ discard block |
||
| 250 | 252 | if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
| 251 | 253 | if($clearance == 3){ |
| 252 | 254 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 253 | - }else{ |
|
| 255 | + } else{ |
|
| 254 | 256 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 255 | 257 | } |
| 256 | 258 | } |
@@ -285,7 +287,7 @@ discard block |
||
| 285 | 287 | if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
| 286 | 288 | if($clearance == 3){ |
| 287 | 289 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 288 | - }else{ |
|
| 290 | + } else{ |
|
| 289 | 291 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 290 | 292 | } |
| 291 | 293 | } |
@@ -310,7 +312,7 @@ discard block |
||
| 310 | 312 | if (!$clearance || time() < strtotime($basicInfo['begin_time'])) { |
| 311 | 313 | if($clearance == 3){ |
| 312 | 314 | return Redirect::route('contest.admin', ['cid' => $cid]); |
| 313 | - }else{ |
|
| 315 | + } else{ |
|
| 314 | 316 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 315 | 317 | } |
| 316 | 318 | } |
@@ -170,7 +170,7 @@ |
||
| 170 | 170 | $del_count ++; |
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | - }else{ |
|
| 173 | + } else{ |
|
| 174 | 174 | $message = static::find($messages); |
| 175 | 175 | if(!empty($message)){ |
| 176 | 176 | $message->delete(); |
@@ -446,7 +446,9 @@ discard block |
||
| 446 | 446 | |
| 447 | 447 | if (!empty($data["sample"])) { |
| 448 | 448 | foreach ($data["sample"] as $d) { |
| 449 | - if(!isset($d['sample_note'])) $d['sample_note']=null; |
|
| 449 | + if(!isset($d['sample_note'])) { |
|
| 450 | + $d['sample_note']=null; |
|
| 451 | + } |
|
| 450 | 452 | DB::table("problem_sample")->insert([ |
| 451 | 453 | 'pid'=>$pid, |
| 452 | 454 | 'sample_input'=>$d['sample_input'], |
@@ -492,7 +494,9 @@ discard block |
||
| 492 | 494 | |
| 493 | 495 | if (!empty($data["sample"])) { |
| 494 | 496 | foreach ($data["sample"] as $d) { |
| 495 | - if(!isset($d['sample_note'])) $d['sample_note']=null; |
|
| 497 | + if(!isset($d['sample_note'])) { |
|
| 498 | + $d['sample_note']=null; |
|
| 499 | + } |
|
| 496 | 500 | DB::table("problem_sample")->insert([ |
| 497 | 501 | 'pid'=>$pid, |
| 498 | 502 | 'sample_input'=>$d['sample_input'], |
@@ -679,7 +683,7 @@ discard block |
||
| 679 | 683 | $top=DB::table('problem_discussion_comment')->where('pdcid','=',$reply_id)->get()->first()['reply_id']; |
| 680 | 684 | if(isset($top)){ |
| 681 | 685 | return $this->replyParent($reply_id); |
| 682 | - }else{ |
|
| 686 | + } else{ |
|
| 683 | 687 | return $reply_id; |
| 684 | 688 | } |
| 685 | 689 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $temp["settings"]=false; |
| 69 | 69 | $temp["available"]=$installedConfig->status; |
| 70 | 70 | } |
| 71 | - }catch (Throwable $e){ |
|
| 71 | + } catch (Throwable $e){ |
|
| 72 | 72 | continue; |
| 73 | 73 | } |
| 74 | 74 | $ret[]=$temp; |
@@ -80,7 +80,9 @@ discard block |
||
| 80 | 80 | { |
| 81 | 81 | $ret=[]; |
| 82 | 82 | $marketspaceRaw=self::getRemote(); |
| 83 | - if(empty($marketspaceRaw)) return []; |
|
| 83 | + if(empty($marketspaceRaw)) { |
|
| 84 | + return []; |
|
| 85 | + } |
|
| 84 | 86 | foreach($marketspaceRaw["packages"] as $extension){ |
| 85 | 87 | $temp=[ |
| 86 | 88 | "details"=>$extension, |
@@ -94,7 +96,7 @@ discard block |
||
| 94 | 96 | try { |
| 95 | 97 | try { |
| 96 | 98 | $BabelConfig=json_decode(file_get_contents(babel_path("Extension/{$extension['code']}/babel.json")), true); |
| 97 | - }catch (Throwable $e){ |
|
| 99 | + } catch (Throwable $e){ |
|
| 98 | 100 | $BabelConfig=[]; |
| 99 | 101 | } |
| 100 | 102 | if (!empty($BabelConfig)) { |
@@ -120,7 +122,7 @@ discard block |
||
| 120 | 122 | $temp["available"]=$installedConfig->status; |
| 121 | 123 | } |
| 122 | 124 | } |
| 123 | - }catch (Throwable $e){ |
|
| 125 | + } catch (Throwable $e){ |
|
| 124 | 126 | continue; |
| 125 | 127 | } |
| 126 | 128 | $ret[]=$temp; |
@@ -136,7 +138,9 @@ discard block |
||
| 136 | 138 | foreach($dirs as $d){ |
| 137 | 139 | $extension=basename($d); |
| 138 | 140 | $BabelConfig=json_decode(file_get_contents(babel_path("Extension/$extension/babel.json")), true); |
| 139 | - if($extension==$BabelConfig["code"]) $ret[]=$BabelConfig; |
|
| 141 | + if($extension==$BabelConfig["code"]) { |
|
| 142 | + $ret[]=$BabelConfig; |
|
| 143 | + } |
|
| 140 | 144 | } |
| 141 | 145 | return $ret; |
| 142 | 146 | } |
@@ -145,7 +149,7 @@ discard block |
||
| 145 | 149 | { |
| 146 | 150 | try { |
| 147 | 151 | return json_decode(file_get_contents(config('babel.mirror')."/babel.json"), true); |
| 148 | - }catch(Throwable $e){ |
|
| 152 | + } catch(Throwable $e){ |
|
| 149 | 153 | return []; |
| 150 | 154 | } |
| 151 | 155 | } |
@@ -153,10 +157,14 @@ discard block |
||
| 153 | 157 | public static function remoteDetail($code) |
| 154 | 158 | { |
| 155 | 159 | $babelConfig=self::getRemote(); |
| 156 | - if(empty($babelConfig)) return []; |
|
| 160 | + if(empty($babelConfig)) { |
|
| 161 | + return []; |
|
| 162 | + } |
|
| 157 | 163 | $babelConfigPackages=$babelConfig["packages"]; |
| 158 | 164 | foreach($babelConfigPackages as $package) { |
| 159 | - if($package["code"]==$code) return $package; |
|
| 165 | + if($package["code"]==$code) { |
|
| 166 | + return $package; |
|
| 167 | + } |
|
| 160 | 168 | } |
| 161 | 169 | return []; |
| 162 | 170 | } |
@@ -245,11 +245,17 @@ |
||
| 245 | 245 | |
| 246 | 246 | $groupModel=new GroupModel(); |
| 247 | 247 | $is_user=$groupModel->isUser($all_data["email"]); |
| 248 | - if(!$is_user) return ResponseModel::err(2006); |
|
| 248 | + if(!$is_user) { |
|
| 249 | + return ResponseModel::err(2006); |
|
| 250 | + } |
|
| 249 | 251 | $clearance=$groupModel->judgeClearance($all_data["gid"], Auth::user()->id); |
| 250 | - if($clearance<2) return ResponseModel::err(7002); |
|
| 252 | + if($clearance<2) { |
|
| 253 | + return ResponseModel::err(7002); |
|
| 254 | + } |
|
| 251 | 255 | $targetClearance=$groupModel->judgeEmailClearance($all_data["gid"], $all_data["email"]); |
| 252 | - if($targetClearance!=-3) return ResponseModel::err(7003); |
|
| 256 | + if($targetClearance!=-3) { |
|
| 257 | + return ResponseModel::err(7003); |
|
| 258 | + } |
|
| 253 | 259 | $groupModel->inviteMember($all_data["gid"], $all_data["email"]); |
| 254 | 260 | $basic = $groupModel->basic($all_data['gid']); |
| 255 | 261 | $url = route('group.detail',['gcode' => $basic['gcode']]); |