public static function conversionFailedSerialization($value, $format, $error, Exception $e = null)
    {
        $actualType = is_object($value) ? get_class($value) : gettype($value);

        return new self(sprintf(
            "Could not convert PHP type '%s' to '%s', as an error was triggered by the serialization: %s",
            $actualType,
            $format,
            $error
        ), 0, $e);
    }
public static function conversionFailedSerialization($value, $format, $error, Exception $e = null)
    {
        $actualType = is_object($value) ? get_class($value) : gettype($value);

        return new self(sprintf(
            "Could not convert PHP type '%s' to '%s', as an error was triggered by the serialization: %s",
            $actualType,
            $format,
            $error
        ), 0, $e);
    }
public static function conversionFailedSerialization ( $ value , $ format , $ error , Exception $ e = null ) { $ actualType = is_object ( $ value ) ? get_class ( $ value ) : gettype ( $ value ) ; return new self ( sprintf ( "Could not convert PHP type '%s' to '%s', as an error was triggered by the serialization: %s" , $ actualType , $ format , $ error ) , 0 , $ e ) ; }
Thrown when a value failed serialisation.

@param mixed          $value
@param string         $format
@param string         $error
@param Exception|null $e

@return ConversionException
Thrown when a value failed serialisation .