public static function fromValueForClass($value, string $class)
    {
        $message = sprintf(
            'Failed to validate value of type %1$s to fit into Value object of type %2$s. (%3$s)',
            is_object($value) ? get_class($value) : gettype($value),
            $class,
            json_encode($value)
        );

        return new static($message);
    }
public static function fromValueForClass($value, string $class)
    {
        $message = sprintf(
            'Failed to validate value of type %1$s to fit into Value object of type %2$s. (%3$s)',
            is_object($value) ? get_class($value) : gettype($value),
            $class,
            json_encode($value)
        );

        return new static($message);
    }
public static function fromValueForClass ( $ value , string $ class ) { $ message = sprintf ( 'Failed to validate value of type %1$s to fit into Value object of type %2$s. (%3$s)' , is_object ( $ value ) ? get_class ( $ value ) : gettype ( $ value ) , $ class , json_encode ( $ value ) ) ; return new static ( $ message ) ; }
Create a new exception instance from a failing value.

@since 0.1.1

@param mixed  $value Value that failed validation.
@param string $class FQCN of the class that the value was validated against.

@return static
Create a new exception instance from a failing value .