@@ -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 | * |
@@ -68,12 +68,12 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | -if (! function_exists('can_view_code')) { |
|
| 71 | +if (!function_exists('can_view_code')) { |
|
| 72 | 72 | function can_view_code($solution) |
| 73 | 73 | { |
| 74 | 74 | /** @var User $user */ |
| 75 | 75 | $user = auth()->user(); |
| 76 | - if (! $user) { |
|
| 76 | + if (!$user) { |
|
| 77 | 77 | return false; |
| 78 | 78 | } |
| 79 | 79 | if ($user->hasRole('admin')) { |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | -if (! function_exists('show_ratio')) { |
|
| 87 | +if (!function_exists('show_ratio')) { |
|
| 88 | 88 | function show_ratio($number, $total) |
| 89 | 89 | { |
| 90 | 90 | $result = 0; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | -if (! function_exists('display_penalize_time')) { |
|
| 99 | +if (!function_exists('display_penalize_time')) { |
|
| 100 | 100 | function display_penalize_time($seconds) |
| 101 | 101 | { |
| 102 | 102 | $hour = (int) ($seconds / (Carbon::SECONDS_PER_MINUTE * Carbon::MINUTES_PER_HOUR)); |
@@ -108,14 +108,14 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | -if (! function_exists('show_order')) { |
|
| 111 | +if (!function_exists('show_order')) { |
|
| 112 | 112 | function show_order($order) |
| 113 | 113 | { |
| 114 | 114 | return chr($order + ord('A')); |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | -if (! function_exists('show_problem_id')) { |
|
| 118 | +if (!function_exists('show_problem_id')) { |
|
| 119 | 119 | /** |
| 120 | 120 | * @param Solution $solution |
| 121 | 121 | * |
@@ -131,21 +131,21 @@ discard block |
||
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | -if (! function_exists('opening_contest')) { |
|
| 134 | +if (!function_exists('opening_contest')) { |
|
| 135 | 135 | function opening_contest() |
| 136 | 136 | { |
| 137 | 137 | return (new ContestService())->openingContest(); |
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | -if (! function_exists('original_order')) { |
|
| 141 | +if (!function_exists('original_order')) { |
|
| 142 | 142 | function original_order($order) |
| 143 | 143 | { |
| 144 | 144 | return ord($order) - ord('A'); |
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | -if (! function_exists('!show_status')) { |
|
| 148 | +if (!function_exists('!show_status')) { |
|
| 149 | 149 | function show_status($status) |
| 150 | 150 | { |
| 151 | 151 | if (array_key_exists($status, Solution::$status)) { |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | $repository->pushCriteria(new Where('result', Status::ACCEPT)); |
| 19 | 19 | $repository->pushCriteria(new Distinct('problem_id')); |
| 20 | 20 | |
| 21 | - return $repository->all('problem_id')->map(function ($item) { |
|
| 21 | + return $repository->all('problem_id')->map(function($item) { |
|
| 22 | 22 | return $item->problem_id; |
| 23 | 23 | }); |
| 24 | 24 | } |
@@ -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')); |
@@ -60,11 +60,11 @@ discard block |
||
| 60 | 60 | public function update($contest) |
| 61 | 61 | { |
| 62 | 62 | /* @var Contest $contest */ |
| 63 | - if (! ($contest instanceof Model)) { |
|
| 63 | + if (!($contest instanceof Model)) { |
|
| 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')); |