public static function fromInstantiationException($class, Exception $exception)
    {
        $message = sprintf(
            'Could not instantiate OptionRepository of type "%1$s". Reason: %2$s',
            is_object($class)
                ? get_class($class)
                : gettype($class),
            $exception->getMessage()
        );

        return new static($message, 0, $exception);
    }
public static function fromInstantiationException($class, Exception $exception)
    {
        $message = sprintf(
            'Could not instantiate OptionRepository of type "%1$s". Reason: %2$s',
            is_object($class)
                ? get_class($class)
                : gettype($class),
            $exception->getMessage()
        );

        return new static($message, 0, $exception);
    }
public static function fromInstantiationException ( $ class , Exception $ exception ) { $ message = sprintf ( 'Could not instantiate OptionRepository of type "%1$s". Reason: %2$s' , is_object ( $ class ) ? get_class ( $ class ) : gettype ( $ class ) , $ exception -> getMessage ( ) ) ; return new static ( $ message , 0 , $ exception ) ; }
Get a new exception based on an exception that was thrown during instantiation of a class.

@since 0.1.4

@param mixed     $class     Class that was tried to be instantiated.
@param Exception $exception Exception that was thrown during instantiation.

@return static
Get a new exception based on an exception that was thrown during instantiation of a class .