public void check(Environment env) {
            if (overrideConstants_ != null)
                for (InvalidConstant el : this.overrideConstants_) {
                    ErrorException e = null;

                    switch (el.kind) {
                        case INVALID_OVERRIDE:
                            e = new FatalException(Messages.ERR_CANNOT_INHERIT_OVERRIDE_CONSTANT.fetch(
                                    el.constant.getName(), el.prototype.getClazz().getName()
                            ), getTrace());
                            break;

                        case MUST_BE_PUBLIC:
                            e = new FatalException(Messages.ERR_ACCESS_LEVEL_CONSTANT_MUST_BE_PUBLIC.fetch(
                                    el.constant.getClazz().getName(),
                                    el.constant.getName(), el.prototype.getClazz().getName()
                            ), getTrace());
                            break;

                        case MUST_BE_PUBLIC_FOR_INTERFACE:
                            e = new FatalException(Messages.ERR_ACCESS_LEVEL_CONSTANT_MUST_BE_PUBLIC_FOR_INTERFACE.fetch(
                                    el.constant.getClazz().getName(),
                                    el.constant.getName()
                            ), getTrace());
                            break;

                        case MUST_BE_PROTECTED:
                            e = new FatalException(Messages.ERR_ACCESS_LEVEL_CONSTANT_MUST_BE_PROTECTED.fetch(
                                    el.constant.getClazz().getName(),
                                    el.constant.getName(), el.prototype.getClazz().getName()
                            ), getTrace());
                            break;
                    }

                    if (e != null) {
                        if (env == null)
                            throw e;
                        else {
                            env.error(e.getTraceInfo(), el.errorType, e.getMessage());
                        }
                    }
                }

            Set<InvalidMethod> nonExists = null;
            for (InvalidMethod el : methods) {
                ErrorException e = null;
                switch (el.kind) {
                    case INVALID_SIGNATURE:
                        MethodEntity prototype = el.method.getPrototype();
                        if (!prototype.isAbstractable()) {
                            while (prototype.prototype != null && prototype.prototype.isAbstractable())
                                prototype = prototype.prototype;
                        }
                        e = new FatalException(
                                Messages.ERR_INVALID_METHOD_SIGNATURE.fetch(
                                        el.method.getSignatureString(true, true), prototype.getSignatureString(true, true)
                                ),
                                el.method.getTrace()
                        );
                        break;
                    case MUST_STATIC:
                        e = new FatalException(
                                Messages.ERR_CANNOT_MAKE_STATIC_TO_NON_STATIC.fetch(
                                        el.method.getPrototype().getSignatureString(false),
                                        ClassEntity.this.getName()
                                ),
                                el.method.getTrace()
                        );
                        break;
                    case MUST_NON_STATIC:
                        e = new FatalException(
                                Messages.ERR_CANNOT_MAKE_NON_STATIC_TO_STATIC.fetch(
                                        el.method.getPrototype().getSignatureString(false),
                                        ClassEntity.this.getName()
                                ),
                                el.method.getTrace()
                        );
                        break;
                    case MAGIC_MUST_BE_PUBLIC:
                        env.error(el.method.getTrace(), el.errorType,
                                "The magic method %s must have public visibility", el.method.getSignatureString(false)
                        );
                        break;
                    case MUST_BE_PROTECTED:
                        e = new FatalException(
                                Messages.ERR_ACCESS_LEVEL_METHOD_MUST_BE_PROTECTED_OR_WEAKER.fetch(
                                        el.method.clazz.getName(),
                                        el.method.getName(),
                                        el.method.getPrototype().getClazz().getName()
                                ),
                                el.method.getTrace()
                        );
                        break;
                    case MUST_BE_PUBLIC:
                        e = new FatalException(
                                Messages.ERR_ACCESS_LEVEL_METHOD_MUST_BE_PUBLIC.fetch(
                                        el.method.clazz.getName(),
                                        el.method.getName(),
                                        el.method.getPrototype().getClazz().getName()
                                ),
                                el.method.getTrace()
                        );
                        break;
                    case FINAL_ABSTRACT:
                        e = getException(env, el, Messages.ERR_CANNOT_USE_FINAL_ON_ABSTRACT);
                        break;
                    case FINAL:
                        e = getException(env, el, Messages.ERR_CANNOT_OVERRIDE_FINAL_METHOD, true);
                        break;
                    case NON_ABSTRACT:
                        e = getException(env, el, Messages.ERR_NON_ABSTRACT_METHOD_MUST_CONTAIN_BODY);
                        break;
                    case NON_ABSTRACTABLE:
                        e = getException(env, el, Messages.ERR_ABSTRACT_METHOD_CANNOT_CONTAIN_BODY);
                        break;
                    case INVALID_ACCESS_FOR_INTERFACE:
                        e = getException(env, el, Messages.ERR_ACCESS_TYPE_FOR_INTERFACE_METHOD);
                        break;
                    case NON_EXISTS:
                        if (nonExists == null) nonExists = new HashSet<>();
                        nonExists.add(el);
                        break;
                }

                if (e != null) {
                    if (env == null)
                        throw e;
                    else {
                        env.error(e.getTraceInfo(), el.errorType, e.getMessage());
                    }
                }
            }

            if (nonExists != null) {
                StringBuilder needs = new StringBuilder();
                Iterator<InvalidMethod> iterator = nonExists.iterator();
                int size = 0;
                ErrorType errorType = ErrorType.E_NOTICE;

                while (iterator.hasNext()) {
                    InvalidMethod el = iterator.next();
                    if (el.errorType.value < errorType.value)
                        errorType = el.errorType;

                    needs.append(el.method.getClazz().getName())
                            .append("::")
                            .append(el.method.getName());

                    if (iterator.hasNext())
                        needs.append(", ");
                    size++;
                }

                ErrorException e = new FatalException(
                        Messages.ERR_IMPLEMENT_METHOD.fetch(ClassEntity.this.getName(), size, needs),
                        ClassEntity.this.getTrace()
                );

                if (env == null)
                    throw e;
                else {
                    env.error(e.getTraceInfo(), errorType, e.getMessage());
                }
            }
        }
return empty list if success else list with not valid implemented methods in class

@param _interface
@return
jphp-runtime/src/php/runtime/reflection/ClassEntity.java