BroadcastNotification   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A broadcastOn() 0 4 1
1
<?php
2
3
namespace Modules\Notification\Events;
4
5
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
6
use Illuminate\Contracts\Queue\ShouldQueue;
7
use Illuminate\Queue\SerializesModels;
8
use Modules\Notification\Entities\Notification;
9
10
class BroadcastNotification implements ShouldBroadcast, ShouldQueue
11
{
12
    use SerializesModels;
13
14
    /**
15
     * @var Notification
16
     */
17
    public $notification;
18
19
    public function __construct(Notification $notification)
20
    {
21
        $this->notification = $notification;
22
    }
23
24
    /**
25
     * Get the channels the event should broadcast on.
26
     * @return array
27
     */
28
    public function broadcastOn()
29
    {
30
        return ['asgardcms.notifications.' . $this->notification->user_id];
31
    }
32
}
33