UserCreated   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
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\Contracts\Broadcasting\ShouldBroadcast;
7
use Illuminate\Queue\SerializesModels;
8
use Illuminate\Broadcasting\PrivateChannel;
9
use Illuminate\Foundation\Events\Dispatchable;
10
use Illuminate\Broadcasting\InteractsWithSockets;
11
12
/**
13
 * Class UserCreated.
14
 *
15
 * @package Acacha\Users\Events
16
 */
17
class UserCreated implements ShouldBroadcast
18
{
19
    use Dispatchable, InteractsWithSockets, SerializesModels;
20
21
    public $user;
22
23
    /**
24
     * UserCreated constructor.
25
     *
26
     * @param $user
27
     */
28
    public function __construct($user)
29
    {
30
        $this->user = $user;
31
    }
32
33
34
    /**
35
     * Get the channels the event should broadcast on.
36
     *
37
     * @return Channel|array
38
     */
39
    public function broadcastOn()
40
    {
41
        return new PrivateChannel('acacha-users');
42
    }
43
}
44