@@ -38,8 +38,8 @@ discard block |
||
| 38 | 38 | //writing database |
| 39 | 39 | $this->transactionDB(); |
| 40 | 40 | |
| 41 | - }catch(Throwable $e){ |
|
| 42 | - if ($e->getMessage()!==""){ |
|
| 41 | + } catch (Throwable $e) { |
|
| 42 | + if ($e->getMessage()!=="") { |
|
| 43 | 43 | $this->command->line("\n <bg=red;fg=white> {$e->getMessage()} </>\n"); |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | public function __construct($class) |
| 59 | 59 | { |
| 60 | 60 | $this->command=$class; |
| 61 | - $this->versionParser = new VersionConstraintParser(); |
|
| 61 | + $this->versionParser=new VersionConstraintParser(); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | |
@@ -136,8 +136,8 @@ discard block |
||
| 136 | 136 | private function delFile($dirName) |
| 137 | 137 | { |
| 138 | 138 | if (file_exists($dirName) && $handle=opendir($dirName)) { |
| 139 | - while (false!==($item = readdir($handle))) { |
|
| 140 | - if ($item!= "." && $item != "..") { |
|
| 139 | + while (false!==($item=readdir($handle))) { |
|
| 140 | + if ($item!="." && $item!="..") { |
|
| 141 | 141 | if (file_exists($dirName.'/'.$item) && is_dir($dirName.'/'.$item)) { |
| 142 | 142 | $this->delFile($dirName.'/'.$item); |
| 143 | 143 | } else { |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | private function parseVersion() |
| 155 | 155 | { |
| 156 | - if(empty($this->babelConfig)){ |
|
| 156 | + if (empty($this->babelConfig)) { |
|
| 157 | 157 | throw new Exception('Missing babel.json Config file.'); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -220,7 +220,7 @@ discard block |
||
| 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"); |
@@ -308,9 +308,9 @@ discard block |
||
| 308 | 308 | $installed_timestamp=intval($info["compiler_timestamp"]); |
| 309 | 309 | } |
| 310 | 310 | $latest_timestamp=$installed_timestamp; |
| 311 | - $ConpilerConfig = glob(babel_path("Extension/$ocode/compiler/*.*")); |
|
| 311 | + $ConpilerConfig=glob(babel_path("Extension/$ocode/compiler/*.*")); |
|
| 312 | 312 | foreach ($ConpilerConfig as $file) { |
| 313 | - if (intval(basename($file)) > $installed_timestamp) { |
|
| 313 | + if (intval(basename($file))>$installed_timestamp) { |
|
| 314 | 314 | try { |
| 315 | 315 | $this->commitCompiler($file, json_decode(file_get_contents($file), true)); |
| 316 | 316 | $latest_timestamp=intval(basename($file)); |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | $contestModel=new ContestModel(); |
| 25 | 25 | $verified=$contestModel->isVerified($cid); |
| 26 | 26 | $clearance=$contestModel->judgeClearance($cid, Auth::user()->id); |
| 27 | - if ($clearance <= 2) { |
|
| 27 | + if ($clearance<=2) { |
|
| 28 | 28 | return Redirect::route('contest_detail', ['cid' => $cid]); |
| 29 | 29 | } |
| 30 | 30 | $contest_name=$contestModel->contestName($cid); |
@@ -52,30 +52,30 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | $contestModel=new ContestModel(); |
| 54 | 54 | $clearance=$contestModel->judgeClearance($cid, Auth::user()->id); |
| 55 | - if ($clearance <= 2) { |
|
| 55 | + if ($clearance<=2) { |
|
| 56 | 56 | return Redirect::route('contest_detail', ['cid' => $cid]); |
| 57 | 57 | } |
| 58 | 58 | $account=$contestModel->getContestAccount($cid); |
| 59 | - if($account==null){ |
|
| 60 | - return ; |
|
| 61 | - }else{ |
|
| 59 | + if ($account==null) { |
|
| 60 | + return; |
|
| 61 | + } else { |
|
| 62 | 62 | $AccountExport=new AccountExport($account); |
| 63 | 63 | $filename="ContestAccount$cid"; |
| 64 | 64 | return Excel::download($AccountExport, $filename.'.xlsx'); |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - public function refreshContestRank($cid){ |
|
| 68 | + public function refreshContestRank($cid) { |
|
| 69 | 69 | $contestModel=new ContestModel(); |
| 70 | 70 | $clearance=$contestModel->judgeClearance($cid, Auth::user()->id); |
| 71 | - if ($clearance <= 2) { |
|
| 71 | + if ($clearance<=2) { |
|
| 72 | 72 | return Redirect::route('contest.detail', ['cid' => $cid]); |
| 73 | 73 | } |
| 74 | 74 | $contestRankRaw=$contestModel->contestRankCache($cid); |
| 75 | 75 | Cache::tags(['contest', 'rank'])->put($cid, $contestRankRaw); |
| 76 | 76 | Cache::tags(['contest', 'rank'])->put("contestAdmin$cid", $contestRankRaw); |
| 77 | 77 | $end_time=strtotime(DB::table("contest")->where(["cid"=>$cid])->select("end_time")->first()["end_time"]); |
| 78 | - if(time() > $end_time){ |
|
| 78 | + if (time()>$end_time) { |
|
| 79 | 79 | $contestModel->storeContestRankInMySQL($cid, $contestRankRaw); |
| 80 | 80 | } |
| 81 | 81 | return Redirect::route('contest.rank', ['cid' => $cid]); |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | ]; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - $editor_left_width = $accountModel->getExtra(Auth::user()->id, 'editor_left_width'); |
|
| 110 | - if(empty($editor_left_width)) $editor_left_width='40'; |
|
| 109 | + $editor_left_width=$accountModel->getExtra(Auth::user()->id, 'editor_left_width'); |
|
| 110 | + if (empty($editor_left_width)) $editor_left_width='40'; |
|
| 111 | 111 | |
| 112 | 112 | return view('contest.board.editor', [ |
| 113 | 113 | 'page_title'=>"Problem Detail", |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | ]); |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | - public function analysis($cid){ |
|
| 268 | + public function analysis($cid) { |
|
| 269 | 269 | $contestModel=new ContestModel(); |
| 270 | 270 | $clearance=$contestModel->judgeClearance($cid, Auth::user()->id); |
| 271 | 271 | if (!$clearance) { |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | $filter["rated"]=isset($all_data["rated"]) ? $all_data["rated"] : null; |
| 28 | 28 | $filter["anticheated"]=isset($all_data["anticheated"]) ? $all_data["anticheated"] : null; |
| 29 | 29 | $filter["practice"]=isset($all_data["practice"]) ? $all_data["practice"] : null; |
| 30 | - $return_list=$contestModel->list($filter,Auth::check()?Auth::user()->id:0); |
|
| 30 | + $return_list=$contestModel->list($filter, Auth::check() ?Auth::user()->id : 0); |
|
| 31 | 31 | $featured=$contestModel->featured(); |
| 32 | 32 | if (is_null($return_list)) { |
| 33 | 33 | if (isset($all_data["page"]) && $all_data["page"]>1) { |