/// <summary> /// Missing function call callback. /// </summary> protected virtual PhpValue InvokeError(Context ctx, PhpValue[] arguments) { throw PhpException.ErrorException(ErrResources.invalid_callback); }
public string ToStringOrThrow(Context ctx) { PhpException.Throw(PhpError.Notice, ErrResources.array_to_string_conversion); return(ToString(ctx)); }
protected override PhpValue InvokeError(Context ctx, PhpValue[] arguments) { PhpException.UndefinedMethodCalled(_class, _method); return(PhpValue.Void); }
protected override PhpValue InvokeError(Context ctx, PhpValue[] arguments) { PhpException.UndefinedFunctionCalled(_function); return(PhpValue.Void); }
/// <summary> /// Creates an instance of a type dynamically with constructor overload resolution. /// </summary> /// <param name="caller"> /// Class context for resolving constructors visibility. /// Can be <c>default(<see cref="RuntimeTypeHandle"/>)</c> to resolve public constructors only.</param> /// <param name="classname">Full name of the class to instantiate. The name uses PHP syntax of name separators (<c>\</c>) and is case insensitive.</param> /// <param name="arguments">Arguments to be passed to the constructor.</param> /// <returns>The object instance.</returns> /// <exception cref="InvalidOperationException">If the class is not declared.</exception> public object Create([ImportCallerClass] RuntimeTypeHandle caller, string classname, params PhpValue[] arguments) { var tinfo = this.GetDeclaredType(classname, true) ?? throw PhpException.ClassNotFoundException(classname); return(Create(caller, tinfo, arguments)); }
public virtual long ToLongOrThrow(ref PhpValue me) => throw PhpException.TypeErrorException();
/// <summary> /// Gets <see cref="PhpArray"/> or throws an exception. /// </summary> public virtual PhpArray ArrayOrThrow(ref PhpValue me) => throw PhpException.TypeErrorException();