use of php.runtime.invoke.Invoker in project jphp by jphp-compiler.
the class ReflectionMethod method invoke.
@Signature({ @Arg(value = "object", optional = @Optional, type = HintType.OBJECT) })
public Memory invoke(Environment env, Memory... args) throws Throwable {
Memory self = args[0];
Memory[] arguments = args.length == 1 ? Memory.CONST_EMPTY_ARRAY : Arrays.copyOfRange(args, 1, args.length - 1);
Invoker invoker;
if (self.isNull()) {
invoker = new StaticMethodInvoker(env, env.trace(), methodEntity.getClazzName(), methodEntity);
} else {
invoker = new DynamicMethodInvoker(env, env.trace(), self.toObject(IObject.class), methodEntity);
}
return invoker.call(arguments);
}
Aggregations