@@ -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)) { |