@@ -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'], |
@@ -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 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | /** @var Problem $problem */ |
29 | 29 | $problem = $this->repository->findOrFail($id); |
30 | - if (! $problem->isAvailable()) { |
|
30 | + if (!$problem->isAvailable()) { |
|
31 | 31 | return back()->withErrors('Problem is not found!'); |
32 | 32 | } |
33 | 33 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | /** @var Problem $problem */ |
55 | 55 | $problem = $this->repository->findOrFail($id); |
56 | - if (! $problem->isAvailable()) { |
|
56 | + if (!$problem->isAvailable()) { |
|
57 | 57 | return back()->withErrors('Problem is not found!'); |
58 | 58 | } |
59 | 59 |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | |
51 | 51 | public function create($id) |
52 | 52 | { |
53 | - if (! auth()->user()) { |
|
53 | + if (!auth()->user()) { |
|
54 | 54 | return redirect(route('problem.view', ['problem' => $id]))->withErrors(__('Login first')); |
55 | 55 | } |
56 | 56 | |
57 | 57 | /** @var Problem $problem */ |
58 | 58 | $problem = app(ProblemRepository::class)->findOrFail($id); |
59 | 59 | |
60 | - if (! config('hustoj.special_judge_enabled') && $problem->isSpecialJudge()) { |
|
60 | + if (!config('hustoj.special_judge_enabled') && $problem->isSpecialJudge()) { |
|
61 | 61 | return redirect(route('problem.view', ['problem' => $id])) |
62 | 62 | ->withErrors(__('Special judge current disabled!')); |
63 | 63 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | { |
96 | 96 | /** @var \App\Entities\Solution $solution */ |
97 | 97 | $solution = app(SolutionRepository::class)->findOrFail($id); |
98 | - if (! can_view_code($solution)) { |
|
98 | + if (!can_view_code($solution)) { |
|
99 | 99 | return redirect(route('solution.index'))->withErrors(__('You have no permission access solution source')); |
100 | 100 | } |
101 | 101 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | { |
107 | 107 | /** @var \App\Entities\Solution $solution */ |
108 | 108 | $solution = app(SolutionRepository::class)->findOrFail($id); |
109 | - if (! can_view_code($solution)) { |
|
109 | + if (!can_view_code($solution)) { |
|
110 | 110 | return back()->withErrors(__('You cannot access this solution')); |
111 | 111 | } |
112 | 112 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | { |
118 | 118 | /** @var \App\Entities\Solution $solution */ |
119 | 119 | $solution = app(SolutionRepository::class)->findOrFail($id); |
120 | - if (! can_view_code($solution)) { |
|
120 | + if (!can_view_code($solution)) { |
|
121 | 121 | return back()->withErrors(__('You cannot access this solution')); |
122 | 122 | } |
123 | 123 |