VideoStreamStarted::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Iman\Streamer\Events;
4
5
use Illuminate\Broadcasting\InteractsWithSockets;
6
use Illuminate\Broadcasting\PrivateChannel;
7
use Illuminate\Foundation\Events\Dispatchable;
8
use Illuminate\Queue\SerializesModels;
9
use Iman\Streamer\Video;
10
11
class VideoStreamStarted
12
{
13
    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\VideoStreamStarted: $id, $class, $connection, $relations
Loading history...
14
    /**
15
     * @var Video
16
     */
17
    private $video;
18
19
    /**
20
     * Create a new event instance.
21
     *
22
     * @param  Video  $video
23
     */
24
    public function __construct(Video $video)
25
    {
26
        $this->video = $video;
27
    }
28
29
    /**
30
     * @return Video
31
     */
32
    public function getVideo(): Video
33
    {
34
        return $this->video;
35
    }
36
37
    /**
38
     * Get the channels the event should broadcast on.
39
     *
40
     * @return \Illuminate\Broadcasting\Channel|array
41
     */
42
    public function broadcastOn()
43
    {
44
        return new PrivateChannel('channel-name');
45
    }
46
}
47