ParticipantJoined   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 15
c 2
b 0
f 0
dl 0
loc 61
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
1
<?php
2
3
namespace SquareetLabs\LaravelOpenVidu\Events;
4
5
6
/**
7
 * Class ParticipantJoined
8
 * @package SquareetLabs\LaravelOpenVidu\Events
9
 */
10
class ParticipantJoined
11
{
12
    /**
13
     * @var string $sessionId
14
     * Session for which the event was triggered
15
     * A string with the session unique identifier
16
     */
17
    public $sessionId;
18
19
    /**
20
     * @var int $timestamp
21
     * Time when the event was triggered
22
     * UTC milliseconds
23
     */
24
    public $timestamp;
25
26
    /**
27
     * @var string $participantId
28
     * Identifier of the participant
29
     * A string with the participant unique identifier
30
     */
31
    public $participantId;
32
33
    /**
34
     * @var string $platform
35
     * Complete description of the platform used by the participant to connect to the session
36
     * A string with the platform description
37
     */
38
    public $platform;
39
40
    /**
41
     * @var string $clientData
42
     * Additional data added client side while connecting to Session
43
     */
44
    public $clientData;
45
46
    /**
47
     * @var string $serverData
48
     * Additional data added server side while generating Token
49
     */
50
    public $serverData;
51
52
    /**
53
     * @var string $event
54
     * Openvidu server webhook event
55
     */
56
    public $event;
57
58
    /**
59
     * Create a new SessionCreated event instance.
60
     * @param  array  $data
61
     */
62
    public function __construct(array $data)
63
    {
64
        $this->sessionId = $data['sessionId'];
65
        $this->timestamp = $data['timestamp'];
66
        $this->participantId = $data['participantId'];
67
        $this->platform = $data['platform'];
68
        $this->clientData = $data['clientData'] ?? "";
69
        $this->serverData = $data['serverData'] ?? "";
70
        $this->event = $data['event'];
71
    }
72
}
73
74