Search in sources :

Example 61 with Invoker

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);
}
Also used : StaticMethodInvoker(php.runtime.invoke.StaticMethodInvoker) StaticMethodInvoker(php.runtime.invoke.StaticMethodInvoker) DynamicMethodInvoker(php.runtime.invoke.DynamicMethodInvoker) Invoker(php.runtime.invoke.Invoker) Memory(php.runtime.Memory) ArrayMemory(php.runtime.memory.ArrayMemory) LongMemory(php.runtime.memory.LongMemory) ObjectMemory(php.runtime.memory.ObjectMemory) StringMemory(php.runtime.memory.StringMemory) DynamicMethodInvoker(php.runtime.invoke.DynamicMethodInvoker)

Aggregations

Invoker (php.runtime.invoke.Invoker)61 Memory (php.runtime.Memory)29 ArrayMemory (php.runtime.memory.ArrayMemory)13 ForeachIterator (php.runtime.lang.ForeachIterator)12 LongMemory (php.runtime.memory.LongMemory)12 ObjectMemory (php.runtime.memory.ObjectMemory)12 StringMemory (php.runtime.memory.StringMemory)10 Environment (php.runtime.env.Environment)7 Signature (php.runtime.annotation.Reflection.Signature)5 KeyValueMemory (php.runtime.memory.KeyValueMemory)5 ReferenceMemory (php.runtime.memory.ReferenceMemory)5 SplClassLoader (php.runtime.env.SplClassLoader)4 FileObject (php.runtime.ext.core.classes.stream.FileObject)4 DynamicMethodInvoker (php.runtime.invoke.DynamicMethodInvoker)4 RunnableInvoker (php.runtime.invoke.RunnableInvoker)3 File (java.io.File)2 MemorySerializer (org.develnext.jphp.json.gson.MemorySerializer)2 UIReader (org.develnext.jphp.swing.loader.UIReader)2 SessionHandler (org.eclipse.jetty.server.session.SessionHandler)2 WebSocketHandler (org.eclipse.jetty.websocket.server.WebSocketHandler)2