Ejemplo n.º 1
0
        public static PhpCallback Create(PhpValue item1, PhpValue item2, RuntimeTypeHandle callerCtx = default, object callerObj = null)
        {
            if (item2.IsString(out var method))
            {
                if (item1.AsObject() != null || item1.IsString())
                {
                    // creates callback from an array,
                    // array entries must be dereferenced so they cannot be changed gainst
                    return(new ArrayCallback(item1.GetValue(), method, callerCtx)
                    {
                        Target = callerObj
                    });
                }
            }

            //
            return(CreateInvalid());
        }
Ejemplo n.º 2
0
 public static PhpCallback Create(PhpValue item1, PhpValue item2, RuntimeTypeHandle callerCtx = default(RuntimeTypeHandle)) => new ArrayCallback(item1.GetValue(), item2.GetValue(), callerCtx);  // creates callback to an array, array entries must be dereferenced so they cannot be changed gainst