Search in sources :

Example 11 with FunctionEntity

use of php.runtime.reflection.FunctionEntity in project jphp by jphp-compiler.

the class ReflectionParameter method getDeclaringClass.

@Signature
public Memory getDeclaringClass(Environment env, Memory... args) {
    if (functionEntity == null)
        return Memory.NULL;
    if (functionEntity instanceof FunctionEntity)
        return Memory.NULL;
    MethodEntity method = (MethodEntity) functionEntity;
    ClassEntity classEntity = env.fetchClass("ReflectionClass");
    ReflectionClass r = new ReflectionClass(env, classEntity);
    r.setEntity(method.getClazz());
    return new ObjectMemory(r);
}
Also used : ClassEntity(php.runtime.reflection.ClassEntity) AbstractFunctionEntity(php.runtime.reflection.support.AbstractFunctionEntity) FunctionEntity(php.runtime.reflection.FunctionEntity) ObjectMemory(php.runtime.memory.ObjectMemory) MethodEntity(php.runtime.reflection.MethodEntity)

Aggregations

FunctionEntity (php.runtime.reflection.FunctionEntity)11 ClassEntity (php.runtime.reflection.ClassEntity)5 ClosureEntity (php.runtime.reflection.helper.ClosureEntity)4 DumpException (php.runtime.loader.dump.io.DumpException)3 GeneratorEntity (php.runtime.reflection.helper.GeneratorEntity)3 AbstractFunctionEntity (php.runtime.reflection.support.AbstractFunctionEntity)3 DumpInputStream (php.runtime.loader.dump.io.DumpInputStream)2 ObjectMemory (php.runtime.memory.ObjectMemory)2 ConstantEntity (php.runtime.reflection.ConstantEntity)2 ParameterEntity (php.runtime.reflection.ParameterEntity)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 Test (org.junit.Test)1 Invoker (php.runtime.invoke.Invoker)1 DumpOutputStream (php.runtime.loader.dump.io.DumpOutputStream)1 ArrayMemory (php.runtime.memory.ArrayMemory)1 StringMemory (php.runtime.memory.StringMemory)1 MethodEntity (php.runtime.reflection.MethodEntity)1 ModuleEntity (php.runtime.reflection.ModuleEntity)1