public function convertToPHPValue($value)
{
if ($value === null) {
return null;
}
$value = is_resource($value) ? stream_get_contents($value) : $value;
$val = unserialize($value);
if ($val === false && $value != 'b:0;') {
throw ConversionException::conversionFailed($value, $this->getName());
}
return $val;
}