Completed
Push — master ( 58043b...413e7c )
by Sergi Tur
06:39
created

MigrateUsers::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 5
rs 9.4285
c 1
b 0
f 0
1
<?php
2
3
namespace Acacha\Users\Jobs;
4
5
use Acacha\Users\Services\UserMigrations;
6
use Illuminate\Bus\Queueable;
7
use Illuminate\Queue\SerializesModels;
8
use Illuminate\Queue\InteractsWithQueue;
9
use Illuminate\Contracts\Queue\ShouldQueue;
10
use Illuminate\Foundation\Bus\Dispatchable;
11
12
/**
13
 * Class MigrateUsers
14
 *
15
 * @package Acacha\Users\Jobs
16
 */
17
class MigrateUsers implements ShouldQueue
18
{
19
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
20
21
    /**
22
     * Users to migrate.
23
     *
24
     * @var $usersToMigrate
25
     */
26
    public $usersToMigrate;
27
28
    /**
29
     * Migration batch.
30
     *
31
     * @var $usersToMigrate
32
     */
33
    public $batch;
34
35
    /**
36
     * MigrateUsers constructor.
37
     *
38
     * @param $usersToMigrate
39
     * @param $batch
40
     */
41
    public function __construct($usersToMigrate, $batch)
42
    {
43
        $this->usersToMigrate = $usersToMigrate;
44
        $this->batch = $batch;
45
    }
46
47
    /**
48
     * Execute the job.
49
     *
50
     * @return void
51
     */
52
    public function handle(UserMigrations $service)
53
    {
54
        $service->migrate($this->usersToMigrate, $this->batch);
55
    }
56
57
}
58