Pchp.Library.Objects.interface_exists C# (CSharp) Method

interface_exists() public static method

Tests whether a given interface is defined.
public static interface_exists ( Context ctx, string ifaceName, bool autoload = true ) : bool
ctx Pchp.Core.Context Current runtime context.
ifaceName string The name of the interface.
autoload bool Whether to attempt to call __autoload.
return bool
		public static bool interface_exists(Context ctx, string ifaceName, bool autoload = true)
        {
            var info = ctx.GetDeclaredType(ifaceName);
            if (info == null && autoload)
            {
                throw new NotImplementedException("autoload");
            }

            //
            return info != null && info.Type.GetTypeInfo().IsInterface;
        }
    }