Completed
Push — master ( 2ff197...58043b )
by Sergi Tur
06:57
created

UserMigrationStatusUpdated::broadcastOn()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Acacha\Users\Events;
4
5
use Illuminate\Broadcasting\Channel;
6
use Illuminate\Queue\SerializesModels;
7
use Illuminate\Foundation\Events\Dispatchable;
8
use Illuminate\Broadcasting\InteractsWithSockets;
9
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
10
11
/**
12
 * Class UserMigrationStatusUpdated
13
 *
14
 * @package Acacha\Users\Events
15
 */
16
class UserMigrationStatusUpdated implements ShouldBroadcast
17
{
18
    use Dispatchable, InteractsWithSockets, SerializesModels;
19
20
    /**
21
     * Migrated user.
22
     *
23
     * @var
24
     */
25
    public $user;
26
27
    /**
28
     * Progress status value.
29
     *
30
     * @var
31
     */
32
    public $progress;
33
34
    /**
35
     * Create a new event instance.
36
     *
37
     * @param $user
38
     */
39
    public function __construct($user, $progress)
40
    {
41
        $this->user = $user;
42
        $this->progress = $progress;
43
    }
44
45
    /**
46
     * Get the channels the event should broadcast on.
47
     *
48
     * @return Channel|array
49
     */
50
    public function broadcastOn()
51
    {
52
        return new Channel('users-migration');
53
    }
54
}
55