Passed
Pull Request — master (#189)
by Ghazi
10:24
created

GetRecordingsResponse::getRecords()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
c 2
b 0
f 0
dl 0
loc 10
rs 10
cc 3
nc 2
nop 0
1
<?php
2
3
/*
4
 * BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
5
 *
6
 * Copyright (c) 2016-2022 BigBlueButton Inc. and by respective authors (see below).
7
 *
8
 * This program is free software; you can redistribute it and/or modify it under the
9
 * terms of the GNU Lesser General Public License as published by the Free Software
10
 * Foundation; either version 3.0 of the License, or (at your option) any later
11
 * version.
12
 *
13
 * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
14
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
15
 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Lesser General Public License along
18
 * with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
19
 */
20
21
namespace BigBlueButton\Responses;
22
23
use BigBlueButton\Core\Record;
24
25
/**
26
 * Class GetRecordingsResponse.
27
 */
28
class GetRecordingsResponse extends BaseResponse
29
{
30
    /**
31
     * @var Record[]
32
     */
33
    private $records;
34
35
    /**
36
     * @return Record[]
37
     */
38
    public function getRecords()
39
    {
40
        if (null === $this->records) {
41
            $this->records = [];
42
            foreach ($this->rawXml->recordings->children() as $recordXml) {
43
                $this->records[] = new Record($recordXml);
44
            }
45
        }
46
47
        return $this->records;
48
    }
49
}
50