Completed
Push — master ( faf626...5021ae )
by he
07:04
created
app/Console/Commands/Migrations/TopicMigration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 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
             }
Please login to merge, or discard this patch.
app/Console/Commands/Migrations/ContestMigration.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
     public function handle($command)
12 12
     {
13 13
         $command->info('Migrating Contest...');
14
-        $this->table('contest')->orderBy('contest_id', 'asc')->chunk(100, function ($objects) {
15
-            $objects->map(function ($object) {
14
+        $this->table('contest')->orderBy('contest_id', 'asc')->chunk(100, function($objects) {
15
+            $objects->map(function($object) {
16 16
                 $this->transform($object);
17 17
             });
18 18
         });
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $perm = 'c'.$contest->id;
65 65
         $perms = $this->table('privilege')->where('rightstr', $perm)->distinct('user_id')->get();
66 66
 
67
-        $perms->map(function ($perm) use ($contest) {
67
+        $perms->map(function($perm) use ($contest) {
68 68
             /** @var User $user */
69 69
             $user = app(UserService::class)->findByName($perm->user_id);
70 70
             $contest->users()->attach($user);
Please login to merge, or discard this patch.
app/Console/Commands/Migrations/ArticleMigration.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@
 block discarded – undo
10 10
     public function handle($command)
11 11
     {
12 12
         $command->info('Migrating Articles...');
13
-        $this->table('news')->orderBy('news_id', 'asc')->chunk(100, function ($objects) {
14
-            $objects->map(function ($object) {
13
+        $this->table('news')->orderBy('news_id', 'asc')->chunk(100, function($objects) {
14
+            $objects->map(function($object) {
15 15
                 $this->transformArticle($object);
16 16
             });
17 17
         });
Please login to merge, or discard this patch.
app/Console/Commands/Migrations/UserMigration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
     public function handle($command)
10 10
     {
11 11
         $command->info('Migrating Users...');
12
-        $this->table('users')->orderBy('reg_time', 'asc')->chunk(100, function ($objects) {
12
+        $this->table('users')->orderBy('reg_time', 'asc')->chunk(100, function($objects) {
13 13
             foreach ($objects as $object) {
14 14
                 $this->transform($object);
15 15
             }
Please login to merge, or discard this patch.
app/Console/Commands/Migrations/LoginLogMigration.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     public function handle($command)
16 16
     {
17 17
         $command->info('Migrating Login Logs...');
18
-        User::chunk(100, function ($users) {
18
+        User::chunk(100, function($users) {
19 19
             foreach ($users as $user) {
20 20
                 $this->processUser($user);
21 21
             }
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,15 +44,15 @@
 block discarded – undo
44 44
     {
45 45
         $now = Carbon::now()->subDays($days)->setTime(0, 0);
46 46
         $logs = $this->getTable()->where('user_id', $user->username)
47
-                     ->where('time', $now, '>')
48
-                     ->orderBy('time', 'asc')
49
-                     ->get();
47
+                        ->where('time', $now, '>')
48
+                        ->orderBy('time', 'asc')
49
+                        ->get();
50 50
 
51 51
         if ($logs->count() < 10) {
52 52
             $logs = $this->getTable()->where('user_id', $user->username)
53
-                         ->limit(10)
54
-                         ->orderBy('time', 'desc')
55
-                         ->get();
53
+                            ->limit(10)
54
+                            ->orderBy('time', 'desc')
55
+                            ->get();
56 56
             $logs = $logs->reverse();
57 57
         }
58 58
 
Please login to merge, or discard this patch.
app/Console/Commands/Migrations/SolutionMigration.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,25 +13,25 @@
 block discarded – undo
13 13
     public function handle($command)
14 14
     {
15 15
         $command->info('Migrating Solutions...');
16
-        $this->table('solution')->orderBy('solution_id', 'asc')->chunk(100, function ($objects) {
16
+        $this->table('solution')->orderBy('solution_id', 'asc')->chunk(100, function($objects) {
17 17
             foreach ($objects as $object) {
18 18
                 $this->transformSolution($object);
19 19
             }
20 20
         });
21 21
         $command->info('Migrating Runtime Info...');
22
-        $this->table('runtimeinfo')->orderBy('solution_id', 'asc')->chunk(100, function ($objects) {
22
+        $this->table('runtimeinfo')->orderBy('solution_id', 'asc')->chunk(100, function($objects) {
23 23
             foreach ($objects as $object) {
24 24
                 $this->transformRuntimeInfo($object);
25 25
             }
26 26
         });
27 27
         $command->info('Migrating Compile Info...');
28
-        $this->table('compileinfo')->orderBy('solution_id', 'asc')->chunk(100, function ($objects) {
28
+        $this->table('compileinfo')->orderBy('solution_id', 'asc')->chunk(100, function($objects) {
29 29
             foreach ($objects as $object) {
30 30
                 $this->transformCompileInfo($object);
31 31
             }
32 32
         });
33 33
         $command->info('Migrating Source Code...');
34
-        $this->table('source_code')->orderBy('solution_id', 'asc')->chunk(100, function ($objects) {
34
+        $this->table('source_code')->orderBy('solution_id', 'asc')->chunk(100, function($objects) {
35 35
             foreach ($objects as $object) {
36 36
                 $this->transformSource($object);
37 37
             }
Please login to merge, or discard this patch.
app/Console/Commands/Migrations/ProblemMigration.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@
 block discarded – undo
9 9
     public function handle($command)
10 10
     {
11 11
         $command->info('Migrating Problems...');
12
-        $this->table('problem')->orderBy('problem_id', 'asc')->chunk(100, function ($objects) {
13
-            $objects->map(function ($object) {
12
+        $this->table('problem')->orderBy('problem_id', 'asc')->chunk(100, function($objects) {
13
+            $objects->map(function($object) {
14 14
                 $this->transform($object);
15 15
             });
16 16
         });
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
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
             $model->access = $model->lastAccess->first();
37 37
             $model->addHidden('lastAccess');
38 38
 
39
-            $model->roles_edit = $model->roles->map(function ($role) {
39
+            $model->roles_edit = $model->roles->map(function($role) {
40 40
                 return $role->id;
41 41
             });
42 42
             $model->addHidden('roles');
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/ContestController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
      */
67 67
     protected function updateOrSave($model)
68 68
     {
69
-        app('db')->transaction(function () use ($model) {
69
+        app('db')->transaction(function() use ($model) {
70 70
             $attrs = request()->except(['start_time', 'end_time']);
71 71
             $model->fill($attrs);
72 72
             $model->start_time = Carbon::parse(request('start_time'));
Please login to merge, or discard this patch.