private static function getRequest($request, array $config = null)
    {
        if (is_string($request)) {
            return new Request(
                $request,
                isset($config['class']) ? $config['class'] : null,
                isset($config['config']) ? $config['config'] : []
            );
        }

        if (!($request instanceof Request)) {
            throw new \InvalidArgumentException("Embed::create only accepts instances of Embed\\Request or strings");
        }

        return $request;
    }