Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | public final static function PHPobjectHandler(object $node): object |
||
27 | { |
||
28 | if ($node instanceof Scalar) { |
||
29 | $phpObject = unserialize($node->raw); |
||
30 | // NOTE : we assume this is only used for Object types (if a boolean false is serialized this will FAIL) |
||
31 | if (is_bool($phpObject)) { |
||
32 | throw new \Exception("value for tag 'php/object' could NOT be unserialized"); |
||
33 | } |
||
34 | return $phpObject; |
||
35 | } |
||
36 | throw new \Exception("tag 'php/object' value must NOT be a list"); |
||
37 | } |
||
51 |