Completed
Push — master ( 69aaff...6d3f08 )
by Jignesh
11:34 queued 11:34
created

helpers.php ➔ bigbluebutton()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
1
<?php
2
3
use JoisarJignesh\Bigbluebutton\Bigbluebutton;
4
use JoisarJignesh\Bigbluebutton\Bbb;
5
6
if (! function_exists('Fluent')) {
7
    function Fluent($array)
8
    {
9
        return new \Illuminate\Support\Fluent($array);
10
    }
11
}
12
13
if (! function_exists('XmlToArray')) {
14
    function XmlToArray($xml, $out = [])
0 ignored issues
show
Unused Code introduced by
The parameter $out is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
15
    {
16
        $out = json_decode(
17
            json_encode((array) $xml),
18
            1
19
        );
20
21
        return $out;
22
    }
23
}
24
25
if (!function_exists('bigbluebutton')) {
26
    function bigbluebutton($serverName = null)
27
    {
28
        if (is_null($serverName)) {
29
            return new Bbb(new Bigbluebutton(
30
                config('bigbluebutton.BBB_SERVER_BASE_URL'),
31
                config('bigbluebutton.BBB_SECURITY_SALT')
32
            ));
33
        }
34
35
        return (new Bbb(new Bigbluebutton(null, null)))->server($serverName);
36
    }
37
}
38
39
if (! function_exists('XmlToObject')) {
40
    function XmlToObject($xml)
41
    {
42
        return Fluent(XmlToArray($xml));
43
    }
44
}
45