private static function executeAdapter($adapter, Request $request, array $config = null)
    {
        if (!in_array('Embed\\Adapters\\AdapterInterface', class_implements($adapter))) {
            throw new \InvalidArgumentException("The class '$adapter' must implements 'Embed\\Adapters\\AdapterInterface'");
        }

        if (call_user_func([$adapter, 'check'], $request)) {
            return new $adapter($request, $config);
        }

        return false;
    }