@@ -70,7 +70,7 @@ |
||
| 70 | 70 | ->withErrors('Contest is End!'); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if (! auth()->user()) { |
|
| 73 | + if (!auth()->user()) { |
|
| 74 | 74 | return redirect(route('contest.view', $contest->id)) |
| 75 | 75 | ->withErrors('Login first'); |
| 76 | 76 | } |
@@ -44,12 +44,12 @@ |
||
| 44 | 44 | { |
| 45 | 45 | /** @var User $user */ |
| 46 | 46 | $user = app(UserService::class)->findByName($username); |
| 47 | - if (! $user) { |
|
| 47 | + if (!$user) { |
|
| 48 | 48 | // user may not exist |
| 49 | 49 | return redirect(route('home'))->withErrors('user is not exist!'); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - if (! $user->isActive()) { |
|
| 52 | + if (!$user->isActive()) { |
|
| 53 | 53 | return back()->withErrors('User is not found!'); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | if ($problem) { |
| 83 | 83 | $fs = new Filesystem(); |
| 84 | 84 | $path = config('hustoj.data_path').'/'.$id; |
| 85 | - if (! $fs->exists($path)) { |
|
| 85 | + if (!$fs->exists($path)) { |
|
| 86 | 86 | $fs->makeDirectory($path); |
| 87 | 87 | } |
| 88 | 88 | $files = $fs->files($path); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | if ($problem && request()->hasFile('files')) { |
| 106 | 106 | $fs = new Filesystem(); |
| 107 | 107 | $path = config('hustoj.data_path').'/'.$id; |
| 108 | - if (! $fs->exists($path)) { |
|
| 108 | + if (!$fs->exists($path)) { |
|
| 109 | 109 | $fs->makeDirectory($path); |
| 110 | 110 | } |
| 111 | 111 | /** @var UploadedFile[] $files */ |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function getJudger() |
| 22 | 22 | { |
| 23 | - if (! $this->judger) { |
|
| 23 | + if (!$this->judger) { |
|
| 24 | 24 | $this->judger = app(JudgerService::class)->find($this->getJudgeId()); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | private function addSolution(Solution $solution) |
| 48 | 48 | { |
| 49 | - if (! array_key_exists($solution->user_id, $this->teams)) { |
|
| 49 | + if (!array_key_exists($solution->user_id, $this->teams)) { |
|
| 50 | 50 | $this->teams[$solution->user_id] = new Team($this->contest); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | /** @var $result Team[] */ |
| 64 | 64 | $result = array_values($this->teams); |
| 65 | - usort($result, function ($team1, $team2) { |
|
| 66 | - return ! $this->isBetter($team1, $team2); |
|
| 65 | + usort($result, function($team1, $team2) { |
|
| 66 | + return !$this->isBetter($team1, $team2); |
|
| 67 | 67 | }); |
| 68 | 68 | |
| 69 | 69 | return $result; |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | |
| 18 | 18 | $data = []; |
| 19 | 19 | foreach ($dataInput as $name => $content) { |
| 20 | - if (! array_key_exists($name, $dataOutput)) { |
|
| 20 | + if (!array_key_exists($name, $dataOutput)) { |
|
| 21 | 21 | $message = 'Problem Data is not match!'; |
| 22 | 22 | app('log')->error($message, ['pid' => $id]); |
| 23 | 23 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | public function store() |
| 46 | 46 | { |
| 47 | - app('db')->transaction(function () { |
|
| 47 | + app('db')->transaction(function() { |
|
| 48 | 48 | $manager = new ContestManager(); |
| 49 | 49 | $attrs = request()->except(['start_time', 'end_time']); |
| 50 | 50 | $contest = $manager->create($attrs, request('start_time'), request('end_time')); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $contest = $this->repository->findOrFail($contest); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - app('db')->transaction(function () use ($contest) { |
|
| 67 | + app('db')->transaction(function() use ($contest) { |
|
| 68 | 68 | $manager = new ContestManager(); |
| 69 | 69 | $attrs = request()->except(['start_time', 'end_time']); |
| 70 | 70 | $contest = $manager->update($contest, $attrs, request('start_time'), request('end_time')); |
@@ -9,14 +9,14 @@ discard block |
||
| 9 | 9 | use Illuminate\Database\Eloquent\Collection; |
| 10 | 10 | use Ramsey\Uuid\Uuid; |
| 11 | 11 | |
| 12 | -if (! function_exists('new_judge_code')) { |
|
| 12 | +if (!function_exists('new_judge_code')) { |
|
| 13 | 13 | function new_judge_code() |
| 14 | 14 | { |
| 15 | 15 | return Uuid::getFactory()->uuid4(); |
| 16 | 16 | } |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | -if (! function_exists('get_option')) { |
|
| 19 | +if (!function_exists('get_option')) { |
|
| 20 | 20 | function get_option($name, $default = null) |
| 21 | 21 | { |
| 22 | 22 | /** @var Collection|Option[] $options */ |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | -if (! function_exists('can_attend')) { |
|
| 34 | +if (!function_exists('can_attend')) { |
|
| 35 | 35 | /** |
| 36 | 36 | * @param Contest $contest |
| 37 | 37 | * |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | /** @var User $user */ |
| 43 | 43 | $user = auth()->user(); |
| 44 | - if (! $user) { |
|
| 44 | + if (!$user) { |
|
| 45 | 45 | return false; |
| 46 | 46 | } |
| 47 | 47 | if ($user->hasRole('admin')) { |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | -if (! function_exists('contest_permission')) { |
|
| 55 | +if (!function_exists('contest_permission')) { |
|
| 56 | 56 | /** |
| 57 | 57 | * @param Contest $contest |
| 58 | 58 | * |
@@ -63,16 +63,16 @@ discard block |
||
| 63 | 63 | $contest = $contest->id; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - return 'contest.'. $contest; |
|
| 66 | + return 'contest.'.$contest; |
|
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | -if (! function_exists('can_view_code')) { |
|
| 70 | +if (!function_exists('can_view_code')) { |
|
| 71 | 71 | function can_view_code($solution) |
| 72 | 72 | { |
| 73 | 73 | /** @var User $user */ |
| 74 | 74 | $user = auth()->user(); |
| 75 | - if (! $user) { |
|
| 75 | + if (!$user) { |
|
| 76 | 76 | return false; |
| 77 | 77 | } |
| 78 | 78 | if ($user->hasRole('admin')) { |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | -if (! function_exists('show_ratio')) { |
|
| 86 | +if (!function_exists('show_ratio')) { |
|
| 87 | 87 | function show_ratio($number, $total) |
| 88 | 88 | { |
| 89 | 89 | $result = 0; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | -if (! function_exists('display_penalize_time')) { |
|
| 98 | +if (!function_exists('display_penalize_time')) { |
|
| 99 | 99 | function display_penalize_time($seconds) |
| 100 | 100 | { |
| 101 | 101 | $hour = (int) ($seconds / (Carbon::SECONDS_PER_MINUTE * Carbon::MINUTES_PER_HOUR)); |
@@ -107,14 +107,14 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | -if (! function_exists('show_order')) { |
|
| 110 | +if (!function_exists('show_order')) { |
|
| 111 | 111 | function show_order($order) |
| 112 | 112 | { |
| 113 | 113 | return chr($order + ord('A')); |
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | -if (! function_exists('show_problem_id')) { |
|
| 117 | +if (!function_exists('show_problem_id')) { |
|
| 118 | 118 | /** |
| 119 | 119 | * @param Solution $solution |
| 120 | 120 | * |
@@ -130,21 +130,21 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | -if (! function_exists('opening_contest')) { |
|
| 133 | +if (!function_exists('opening_contest')) { |
|
| 134 | 134 | function opening_contest() |
| 135 | 135 | { |
| 136 | 136 | return (new ContestService())->openingContest(); |
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | -if (! function_exists('original_order')) { |
|
| 140 | +if (!function_exists('original_order')) { |
|
| 141 | 141 | function original_order($order) |
| 142 | 142 | { |
| 143 | 143 | return ord($order) - ord('A'); |
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | -if (! function_exists('!show_status')) { |
|
| 147 | +if (!function_exists('!show_status')) { |
|
| 148 | 148 | function show_status($status) |
| 149 | 149 | { |
| 150 | 150 | if (array_key_exists($status, Solution::$status)) { |