Completed
Push — master ( 78ecab...6c5939 )
by Iman
14s queued 11s
created

VideoStreamEnded   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 35
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A broadcastOn() 0 3 1
A getVideo() 0 3 1
1
<?php
2
3
namespace Iman\Streamer\Events;
4
5
use Illuminate\Broadcasting\Channel;
6
use Illuminate\Broadcasting\InteractsWithSockets;
7
use Illuminate\Broadcasting\PresenceChannel;
8
use Illuminate\Broadcasting\PrivateChannel;
9
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
10
use Illuminate\Foundation\Events\Dispatchable;
11
use Illuminate\Queue\SerializesModels;
12
use Iman\Streamer\Video;
13
14
class VideoStreamEnded
15
{
16
    use Dispatchable, InteractsWithSockets, SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by Iman\Streamer\Events\VideoStreamEnded: $id, $class, $connection, $relations
Loading history...
17
    /**
18
     * @var Video
19
     */
20
    private $video;
21
22
    /**
23
     * Create a new event instance.
24
     *
25
     * @param  Video  $video
26
     */
27
    public function __construct(Video $video)
28
    {
29
        $this->video = $video;
30
    }
31
32
    /**
33
     * @return Video
34
     */
35
    public function getVideo(): Video
36
    {
37
        return $this->video;
38
    }
39
40
41
    /**
42
     * Get the channels the event should broadcast on.
43
     *
44
     * @return \Illuminate\Broadcasting\Channel|array
45
     */
46
    public function broadcastOn()
47
    {
48
        return new PrivateChannel('channel-name');
49
    }
50
}
51