SessionDestroyed   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 13
c 1
b 0
f 0
dl 0
loc 56
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
1
<?php
2
3
namespace SquareetLabs\LaravelOpenVidu\Events;
4
5
6
/**
7
 * Class SessionDestroyed
8
 * @package SquareetLabs\LaravelOpenVidu\Events
9
 */
10
class SessionDestroyed
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
    /**
28
     * @var int $startTime
29
     * Time when the session started
30
     * UTC milliseconds
31
     */
32
    public $startTime;
33
34
    /**
35
     * @var int $duration
36
     * Total duration of the session
37
     * Seconds
38
     */
39
    public $duration;
40
41
    /**
42
     * @var string $reason
43
     * Why the session was destroyed
44
     * ["lastParticipantLeft","sessionClosedByServer","openviduServerStopped"]
45
     */
46
    public $reason;
47
48
    /**
49
     * @var string $event
50
     * Openvidu server webhook event
51
     */
52
    public $event;
53
54
    /**
55
     * Create a new SessionCreated event instance.
56
     * @param  array  $data
57
     */
58
    public function __construct(array $data)
59
    {
60
        $this->sessionId = $data['sessionId'];
61
        $this->timestamp = $data['timestamp'];
62
        $this->startTime = $data['startTime'];
63
        $this->duration = $data['duration'];
64
        $this->reason = $data['reason'];
65
        $this->event = $data['event'];
66
    }
67
}