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

UserMigrationHasBeenPersisted   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 54
rs 10
c 1
b 0
f 0
wmc 4
lcom 1
cbo 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getChannelName() 0 4 1
A setChannelName() 0 4 1
A __construct() 0 4 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 UserMigrationHasBeenPersisted
13
 *
14
 * @package Acacha\Users\Events
15
 */
16
class UserMigrationHasBeenPersisted implements ShouldBroadcast
17
{
18
    use Dispatchable, InteractsWithSockets, SerializesModels;
19
20
    /**
21
     * User migration model.
22
     *
23
     * @var
24
     */
25
    public $userMigration;
26
27
    /**
28
     * Broadcast channel name.
29
     *
30
     * @var string
31
     */
32
    protected $channelName = 'users-migration';
33
34
    /**
35
     * @return string
36
     */
37
    public function getChannelName()
38
    {
39
        return $this->channelName;
40
    }
41
42
    /**
43
     * @param string $channelName
44
     */
45
    public function setChannelName($channelName)
46
    {
47
        $this->channelName = $channelName;
48
    }
49
50
    /**
51
     * UserMigrationhasBeenPersisted constructor.
52
     *
53
     * @param $userMigration
54
     */
55
    public function __construct($userMigration)
56
    {
57
        $this->userMigration = $userMigration;
58
    }
59
60
    /**
61
     * Get the channels the event should broadcast on.
62
     *
63
     * @return Channel|array
64
     */
65
    public function broadcastOn()
66
    {
67
        return new Channel($this->channelName);
68
    }
69
}
70