use of php.runtime.invoke.StaticMethodInvoker in project jphp by jphp-compiler.
the class ReflectionMethod method invokeArgs.
@Signature({ @Arg(value = "object", optional = @Optional, type = HintType.OBJECT), @Arg(value = "args", type = HintType.ARRAY) })
public Memory invokeArgs(Environment env, Memory... args) throws Throwable {
Memory self = args[0];
Memory[] arguments = args[1].toValue(ArrayMemory.class).values();
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);
}
use of php.runtime.invoke.StaticMethodInvoker 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