GameView::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * rmarchiv.tk
5
 * (c) 2016-2017 by Marcel 'ryg' Hering
6
 */
7
8
namespace App\Events;
9
10
use Illuminate\Broadcasting\Channel;
11
use Illuminate\Queue\SerializesModels;
12
use Illuminate\Broadcasting\PrivateChannel;
13
use Illuminate\Broadcasting\InteractsWithSockets;
14
15
class GameView
16
{
17
    use InteractsWithSockets, SerializesModels;
18
19
    public $gameid;
20
21
    /**
22
     * Create a new event instance.
23
     *
24
     * @param $gameid
25
     */
26
    public function __construct($gameid)
27
    {
28
        $this->gameid = $gameid;
29
    }
30
31
    /**
32
     * Get the channels the event should broadcast on.
33
     *
34
     * @return Channel|array
35
     */
36
    public function broadcastOn()
37
    {
38
        return new PrivateChannel('channel-name');
39
    }
40
}
41