@@ -47,7 +47,7 @@ |
||
| 47 | 47 | private function getAdminRole() |
| 48 | 48 | { |
| 49 | 49 | $role = Role::where('name', 'admin')->first(); |
| 50 | - if (! $role) { |
|
| 50 | + if (!$role) { |
|
| 51 | 51 | $role = $this->initialRole(); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | public function handle($command) |
| 12 | 12 | { |
| 13 | 13 | $command->info('Migrating Topic...'); |
| 14 | - $this->table('topic')->orderBy('tid', 'asc')->chunk(100, function ($items) { |
|
| 14 | + $this->table('topic')->orderBy('tid', 'asc')->chunk(100, function($items) { |
|
| 15 | 15 | foreach ($items as $item) { |
| 16 | 16 | $this->transform($item); |
| 17 | 17 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $topic->title = $item->title; |
| 27 | 27 | $topic->contest_id = $item->cid; |
| 28 | 28 | $topic->problem_id = $item->pid; |
| 29 | - if (! $topic->contest_id) { |
|
| 29 | + if (!$topic->contest_id) { |
|
| 30 | 30 | $topic->contest_id = 0; |
| 31 | 31 | } |
| 32 | 32 | $user = app(UserService::class)->findByName($item->author_id); |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | public function make($value, array $options = []) |
| 43 | 43 | { |
| 44 | 44 | $salt = Arr::get($options, 'salt'); |
| 45 | - if (! $salt) { |
|
| 45 | + if (!$salt) { |
|
| 46 | 46 | $this->generateSalt(); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -120,7 +120,7 @@ |
||
| 120 | 120 | public function isFailed() |
| 121 | 121 | { |
| 122 | 122 | // 既不是AC,也不是等待评测,就挂了 |
| 123 | - return ! $this->isAccepted() && ! $this->isPending(); |
|
| 123 | + return !$this->isAccepted() && !$this->isPending(); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | public function isAccepted() |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | private function markProblemAccept($solution) |
| 70 | 70 | { |
| 71 | 71 | $pid = $solution->order; |
| 72 | - if (! array_key_exists($pid, $this->timePassed) || $this->timePassed[$pid] === null) { |
|
| 72 | + if (!array_key_exists($pid, $this->timePassed) || $this->timePassed[$pid] === null) { |
|
| 73 | 73 | $this->timePassed[$pid] = $solution->created_at; |
| 74 | 74 | $this->accepts++; |
| 75 | 75 | } else { |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | private function addFailedCount(Solution $solution) |
| 83 | 83 | { |
| 84 | - if (! array_key_exists($solution->order, $this->waCounts)) { |
|
| 84 | + if (!array_key_exists($solution->order, $this->waCounts)) { |
|
| 85 | 85 | $this->waCounts[$solution->order] = 0; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | { |
| 13 | 13 | public function handle($event) |
| 14 | 14 | { |
| 15 | - if (! $event->user) { |
|
| 15 | + if (!$event->user) { |
|
| 16 | 16 | // no such user in system, don't record it |
| 17 | 17 | $information = [ |
| 18 | 18 | 'name' => $event->credentials['username'], |
@@ -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,12 +52,12 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | -if (! function_exists('can_view_code')) { |
|
| 55 | +if (!function_exists('can_view_code')) { |
|
| 56 | 56 | function can_view_code($solution) |
| 57 | 57 | { |
| 58 | 58 | /** @var User $user */ |
| 59 | 59 | $user = auth()->user(); |
| 60 | - if (! $user) { |
|
| 60 | + if (!$user) { |
|
| 61 | 61 | return false; |
| 62 | 62 | } |
| 63 | 63 | if ($user->hasRole('admin')) { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | -if (! function_exists('show_ratio')) { |
|
| 71 | +if (!function_exists('show_ratio')) { |
|
| 72 | 72 | function show_ratio($number, $total) |
| 73 | 73 | { |
| 74 | 74 | $result = 0; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | -if (! function_exists('display_penalize_time')) { |
|
| 83 | +if (!function_exists('display_penalize_time')) { |
|
| 84 | 84 | function display_penalize_time($seconds) |
| 85 | 85 | { |
| 86 | 86 | $hour = (int) ($seconds / (Carbon::SECONDS_PER_MINUTE * Carbon::MINUTES_PER_HOUR)); |
@@ -92,14 +92,14 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | -if (! function_exists('show_order')) { |
|
| 95 | +if (!function_exists('show_order')) { |
|
| 96 | 96 | function show_order($order) |
| 97 | 97 | { |
| 98 | 98 | return chr($order + ord('A')); |
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | -if (! function_exists('show_problem_id')) { |
|
| 102 | +if (!function_exists('show_problem_id')) { |
|
| 103 | 103 | /** |
| 104 | 104 | * @param Solution $solution |
| 105 | 105 | * |
@@ -115,21 +115,21 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | -if (! function_exists('opening_contest')) { |
|
| 118 | +if (!function_exists('opening_contest')) { |
|
| 119 | 119 | function opening_contest() |
| 120 | 120 | { |
| 121 | 121 | return (new ContestService())->openingContest(); |
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | -if (! function_exists('original_order')) { |
|
| 125 | +if (!function_exists('original_order')) { |
|
| 126 | 126 | function original_order($order) |
| 127 | 127 | { |
| 128 | 128 | return ord($order) - ord('A'); |
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | -if (! function_exists('!show_status')) { |
|
| 132 | +if (!function_exists('!show_status')) { |
|
| 133 | 133 | function show_status($status) |
| 134 | 134 | { |
| 135 | 135 | if (array_key_exists($status, Solution::$status)) { |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | /** @var \App\Entities\Contest $contest */ |
| 22 | 22 | $contest = app(ContestRepository::class)->findOrFail($contest); |
| 23 | 23 | |
| 24 | - if (! $contest->isAvailable()) { |
|
| 24 | + if (!$contest->isAvailable()) { |
|
| 25 | 25 | return back()->withErrors('Contest not found!'); |
| 26 | 26 | } |
| 27 | 27 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | protected function redirectTo($request) |
| 17 | 17 | { |
| 18 | - if (! $request->expectsJson()) { |
|
| 18 | + if (!$request->expectsJson()) { |
|
| 19 | 19 | return route('login'); |
| 20 | 20 | } |
| 21 | 21 | } |