Test Setup Failed
Pull Request — master (#21)
by he
05:29
created
app/Console/Commands/AssignAdmin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Console/Commands/Migrations/TopicMigration.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
app/Hustoj/Hashing/Hasher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Entities/Solution.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@
 block discarded – undo
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()
Please login to merge, or discard this patch.
app/Entities/Team.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Listeners/LoginListener.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
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'],
Please login to merge, or discard this patch.
app/Support/helpers.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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)) {
Please login to merge, or discard this patch.
app/Http/Middleware/AuthorizeContest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Http/Middleware/Authenticate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.