Test Setup Failed
Push — master ( 9340e9...95bd49 )
by he
05:10
created
app/Http/Controllers/Web/UserController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,12 +44,12 @@
 block discarded – undo
44 44
     {
45 45
         /** @var User $user */
46 46
         $user = app(UserService::class)->findByName($username);
47
-        if (! $user) {
47
+        if (!$user) {
48 48
             // user may not exist
49 49
             return redirect(route('home'))->withErrors('user is not exist!');
50 50
         }
51 51
 
52
-        if (! $user->isActive()) {
52
+        if (!$user->isActive()) {
53 53
             return back()->withErrors('User is not found!');
54 54
         }
55 55
 
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/ProblemController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         if ($problem) {
83 83
             $fs = new Filesystem();
84 84
             $path = config('hustoj.data_path').'/'.$id;
85
-            if (! $fs->exists($path)) {
85
+            if (!$fs->exists($path)) {
86 86
                 $fs->makeDirectory($path);
87 87
             }
88 88
             $files = $fs->files($path);
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         if ($problem && request()->hasFile('files')) {
106 106
             $fs = new Filesystem();
107 107
             $path = config('hustoj.data_path').'/'.$id;
108
-            if (! $fs->exists($path)) {
108
+            if (!$fs->exists($path)) {
109 109
                 $fs->makeDirectory($path);
110 110
             }
111 111
             /** @var UploadedFile[] $files */
Please login to merge, or discard this patch.
app/Http/Requests/Judger/JudgerRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 
21 21
     public function getJudger()
22 22
     {
23
-        if (! $this->judger) {
23
+        if (!$this->judger) {
24 24
             $this->judger = app(JudgerService::class)->find($this->getJudgeId());
25 25
         }
26 26
 
Please login to merge, or discard this patch.
app/Services/Ranking.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
     private function addSolution(Solution $solution)
48 48
     {
49
-        if (! array_key_exists($solution->user_id, $this->teams)) {
49
+        if (!array_key_exists($solution->user_id, $this->teams)) {
50 50
             $this->teams[$solution->user_id] = new Team($this->contest);
51 51
         }
52 52
 
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 
63 63
         /** @var $result Team[] */
64 64
         $result = array_values($this->teams);
65
-        usort($result, function ($team1, $team2) {
66
-            return ! $this->isBetter($team1, $team2);
65
+        usort($result, function($team1, $team2) {
66
+            return !$this->isBetter($team1, $team2);
67 67
         });
68 68
 
69 69
         return $result;
Please login to merge, or discard this patch.
app/Services/DataProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 
18 18
         $data = [];
19 19
         foreach ($dataInput as $name => $content) {
20
-            if (! array_key_exists($name, $dataOutput)) {
20
+            if (!array_key_exists($name, $dataOutput)) {
21 21
                 $message = 'Problem Data is not match!';
22 22
                 app('log')->error($message, ['pid' => $id]);
23 23
 
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/ContestController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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'));
Please login to merge, or discard this patch.
app/Support/helpers.php 1 patch
Spacing   +15 added lines, -15 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,7 +52,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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)) {
Please login to merge, or discard this patch.
app/Console/Commands/AddUserAccessTime.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
     public function handle()
44 44
     {
45 45
         $this->total = 0;
46
-        User::all()->chunk(500)->map(function (Collection $users) {
46
+        User::all()->chunk(500)->map(function(Collection $users) {
47 47
             $this->total = $this->total + $users->count();
48 48
             $users->load('logs');
49 49
             foreach ($users as $user) {
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/UserController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
         $models->load('roles');
36 36
 
37 37
         foreach ($models as $model) {
38
-            $model->roles_edit = $model->roles->map(function ($role) {
38
+            $model->roles_edit = $model->roles->map(function($role) {
39 39
                 return $role->id;
40 40
             });
41 41
             $model->addHidden('roles');
Please login to merge, or discard this patch.