Search in sources :

Example 16 with MethodEntity

use of php.runtime.reflection.MethodEntity 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

MethodEntity (php.runtime.reflection.MethodEntity)16 ClassEntity (php.runtime.reflection.ClassEntity)9 ObjectMemory (php.runtime.memory.ObjectMemory)6 Memory (php.runtime.Memory)4 ArrayMemory (php.runtime.memory.ArrayMemory)4 ByteArrayInputStream (java.io.ByteArrayInputStream)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 Test (org.junit.Test)3 StringMemory (php.runtime.memory.StringMemory)3 CriticalException (php.runtime.exceptions.CriticalException)2 IObject (php.runtime.lang.IObject)2 ReferenceMemory (php.runtime.memory.ReferenceMemory)2 ParameterEntity (php.runtime.reflection.ParameterEntity)2 ClassStmtToken (org.develnext.jphp.core.tokenizer.token.stmt.ClassStmtToken)1 MethodStmtToken (org.develnext.jphp.core.tokenizer.token.stmt.MethodStmtToken)1 WrapScopeValue (org.develnext.jphp.swing.classes.WrapScopeValue)1 Closure (php.runtime.lang.Closure)1 DumpException (php.runtime.loader.dump.io.DumpException)1 DumpInputStream (php.runtime.loader.dump.io.DumpInputStream)1 LongMemory (php.runtime.memory.LongMemory)1