src/MultiLanguageWrapper/ClassValidator.php
public function isValid(string $returnTypeClass, $instance): bool
    {
        if (array_key_exists($returnTypeClass, $this->getRequiredFields()) === false) {
            return false;
        }
        foreach ($this->getRequiredFields()[$returnTypeClass] as $property) {
            if (is_array($instance)) {
                foreach ($instance as $item) {
                    if ($item->{$property} === null) {
                        return false;
                    }
                }
            } elseif ($instance->{$property} === null) {
                return false;
            }
        }
        return true;
    }
public function isValid(string $returnTypeClass, $instance): bool
    {
        if (array_key_exists($returnTypeClass, $this->getRequiredFields()) === false) {
            return false;
        }
        foreach ($this->getRequiredFields()[$returnTypeClass] as $property) {
            if (is_array($instance)) {
                foreach ($instance as $item) {
                    if ($item->{$property} === null) {
                        return false;
                    }
                }
            } elseif ($instance->{$property} === null) {
                return false;
            }
        }
        return true;
    }
public function isValid ( string $ returnTypeClass , $ instance ) : bool { if ( array_key_exists ( $ returnTypeClass , $ this -> getRequiredFields ( ) ) === false ) { return false ; } foreach ( $ this -> getRequiredFields ( ) [ $ returnTypeClass ] as $ property ) { if ( is_array ( $ instance ) ) { foreach ( $ instance as $ item ) { if ( $ item -> { $ property } === null ) { return false ; } } } elseif ( $ instance -> { $ property } === null ) { return false ; } } return true ; }
Checks if for a given instance the required fields are not null.

@param string       $returnTypeClass The class type of the instance.
@param object|array $instance        The instance to check.

@return bool
Checks if for a given instance the required fields are not null .