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