Completed
Push — master ( daea38...44c4b6 )
by Ghazi
02:21
created

GetMeetingInfoResponse::getAttendees()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 3
Metric Value
c 3
b 0
f 3
dl 0
loc 13
rs 9.4285
cc 3
eloc 8
nc 3
nop 0
1
<?php
2
/**
3
 * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.
4
 *
5
 * Copyright (c) 2016 BigBlueButton Inc. and by respective authors (see below).
6
 *
7
 * This program is free software; you can redistribute it and/or modify it under the
8
 * terms of the GNU Lesser General Public License as published by the Free Software
9
 * Foundation; either version 3.0 of the License, or (at your option) any later
10
 * version.
11
 *
12
 * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
13
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14
 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public License along
17
 * with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
18
 */
19
namespace BigBlueButton\Responses;
20
21
use BigBlueButton\Core\Attendee;
22
use BigBlueButton\Core\MeetingInfo;
23
24
/**
25
 * Class GetMeetingInfoResponse
26
 * @package BigBlueButton\Responses
27
 */
28
class GetMeetingInfoResponse extends BaseResponse
29
{
30
    /**
31
     * @var MeetingInfo
32
     */
33
    private $meetingInfo;
34
35
    /**
36
     * @var Attendee[]
37
     */
38
    private $attendees;
39
40
    /**
41
     * @var array
42
     */
43
    private $metadata;
0 ignored issues
show
Unused Code introduced by
The property $metadata is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
44
45
    /**
46
     * @return MeetingInfo
47
     */
48
    public function getMeetingInfo()
49
    {
50
        if (!is_null($this->meetingInfo)) {
51
            return $this->meetingInfo;
52
        } else {
53
            $this->meetingInfo = new MeetingInfo($this->rawXml);
54
        }
55
56
        return $this->meetingInfo;
57
    }
58
59
    /**
60
     * @return Attendee[]
61
     */
62
    public function getAttendees()
63
    {
64
        if (!is_null($this->attendees)) {
65
            return $this->attendees;
66
        } else {
67
            $this->attendees = [];
68
            foreach ($this->rawXml->attendees->attendee as $attendeeXml) {
69
                $this->attendees[] = new Attendee($attendeeXml);
70
            }
71
        }
72
73
        return $this->attendees;
74
    }
75
}
76