public MethodEntity duplicateForInject() {
        MethodEntity methodEntity = new MethodEntity(this.context);
        methodEntity.setExtension(getExtension());
        methodEntity.setAbstract(isAbstract);
        methodEntity.setFinal(isFinal);
        methodEntity.setDynamicSignature(isDynamicSignature());
        methodEntity.setModifier(modifier);
        methodEntity.setName(name);
        methodEntity.setStatic(isStatic);
        methodEntity.setAbstractable(isAbstractable());
        methodEntity.setDocComment(getDocComment());
        methodEntity.setParameters(parameters);
        methodEntity.setReturnReference(isReturnReference());
        methodEntity.setEmpty(isEmpty);
        methodEntity.setImmutable(isImmutable);
        methodEntity.setResult(result);
        methodEntity.setUsesStackTrace(isUsesStackTrace());
        methodEntity.setDeprecated(isDeprecated());
        methodEntity.setInternalName(getInternalName());

        methodEntity.setReturnTypeNullable(isReturnTypeNullable());
        methodEntity.setReturnTypeChecker(getReturnTypeChecker());

        if (trace == null || trace == TraceInfo.UNKNOWN)
            methodEntity.setTrace(getClazz().getTrace());
        else
            methodEntity.setTrace(trace);

        return methodEntity;
    }
0 - success
1 - invalid protected
2 - invalid private
@param env
@return
jphp-runtime/src/php/runtime/reflection/MethodEntity.java