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

UserMigrationStatusUpdated   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 39
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A broadcastOn() 0 4 1
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