Passed
Pull Request — master (#45)
by X
02:29
created

xKerman_Restricted_function.php ➔ xKerman_Restricted_unserialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * parse serialized string and return result
5
 *
6
 * @param string $str serialized string
7
 * @return mixed
8
 * @throws UnserializeFailedException
9
 */
10
function xKerman_Restricted_unserialize($str)
11
{
12
    $source = new xKerman_Restricted_Source($str);
13
    $parser = new xKerman_Restricted_ExpressionParser();
14
    list($result, ) = $parser->parse($source);
15
    return $result;
16
}