コード例 #1
0
 /// <summary>
 /// Missing function call callback.
 /// </summary>
 protected virtual PhpValue InvokeError(Context ctx, PhpValue[] arguments)
 {
     throw PhpException.ErrorException(ErrResources.invalid_callback);
 }
コード例 #2
0
ファイル: PhpArray.cs プロジェクト: windsOne/peachpie
 public string ToStringOrThrow(Context ctx)
 {
     PhpException.Throw(PhpError.Notice, ErrResources.array_to_string_conversion);
     return(ToString(ctx));
 }
コード例 #3
0
 protected override PhpValue InvokeError(Context ctx, PhpValue[] arguments)
 {
     PhpException.UndefinedMethodCalled(_class, _method);
     return(PhpValue.Void);
 }
コード例 #4
0
 protected override PhpValue InvokeError(Context ctx, PhpValue[] arguments)
 {
     PhpException.UndefinedFunctionCalled(_function);
     return(PhpValue.Void);
 }
コード例 #5
0
        /// <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));
        }
コード例 #6
0
 public virtual long ToLongOrThrow(ref PhpValue me) => throw PhpException.TypeErrorException();
コード例 #7
0
 /// <summary>
 /// Gets <see cref="PhpArray"/> or throws an exception.
 /// </summary>
 public virtual PhpArray ArrayOrThrow(ref PhpValue me) => throw PhpException.TypeErrorException();