Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
38 | 168 | public function convertToPHPValue($value, AbstractPlatform $platform) |
|
39 | { |
||
40 | 168 | if ($value === null) { |
|
41 | 29 | return null; |
|
42 | } |
||
43 | |||
44 | 139 | $value = is_resource($value) ? stream_get_contents($value) : $value; |
|
45 | |||
46 | set_error_handler(function (int $code, string $message) : void { |
||
47 | 29 | throw ConversionException::conversionFailedUnserialization($this->getName(), $message); |
|
48 | 139 | }); |
|
49 | |||
50 | try { |
||
51 | 139 | return unserialize($value); |
|
52 | } finally { |
||
53 | 139 | restore_error_handler(); |
|
54 | } |
||
81 |