public Memory typedValue(Environment env, TraceInfo trace, Memory value) {
        if (typeChecker != null) {
            if (!checkTypeHinting(env, value)) {
                ModuleEntity module = env.getModuleManager().findModule(trace);

                Memory memory = applyTypeHinting(env, value, module != null && module.isStrictTypes());

                if (memory != null) {
                    value = memory;
                } else {
                    String mustBe = typeChecker.getSignature();
                    if (nullable) {
                        mustBe = "?" + mustBe;
                    }

                    env.exception(trace,
                            BaseTypeError.class,
                            "Cannot assign %s to property %s::$%s of type %s",
                            InvokeArgumentHelper.getGiven(value, true), getClazz().getName(), getName(), mustBe
                    );
                }
            }
        }

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