Completed
Push — master ( 23650d...b8cfa5 )
by Jignesh
01:07
created

initConfig::initSetConfigXml()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 13
rs 9.8333
c 0
b 0
f 0
1
<?php
2
3
4
namespace JoisarJignesh\Bigbluebutton\Services;
5
6
7
use BigBlueButton\Parameters\SetConfigXMLParameters;
8
9
trait initConfig
10
{
11
    /**
12
     * @param $parameters
13
     *
14
     * require fields
15
     * xml
16
     * meetingID
17
     *
18
     * @return SetConfigXMLParameters
19
     */
20
    public function initSetConfigXml(array $parameters)
21
    {
22
        $parameters = Fluent($parameters);
23
        $configXml = new SetConfigXMLParameters($parameters->get('meetingID'));
24
        $rawXml = $parameters->xml;
25
        if (!$parameters->xml instanceof \SimpleXMLElement) {
26
            $rawXml = new \SimpleXMLElement($parameters->xml);
27
        }
28
29
        $configXml->setRawXml($rawXml);
30
31
        return $configXml;
32
    }
33
}
34