code: public static function validate(DataContainerInterface $object)
      {
          $existedFields = [];
  
          foreach ($object->getRequiredFields() as $field => $type) {
              $value = self::getFieldValue($object, $field);
  
              if (empty($value)) {
                  throw new EmptyRequiredPropertyException(sprintf('Required property (%s) is empty', $field), 0, $field);
              }
  
              self::validateValue($value, $field, $type);
              $existedFields[] = $field;
          }
  
          foreach ($object->getOptionalFields() as $field => $type) {
              $value = self::getFieldValue($object, $field);
  
              if (empty($value)) {
                  continue;
              }
  
              self::validateValue($value, $field, $type);
              $existedFields[] = $field;
          }
  
          foreach ($object->getThoughOneField() as $thoughFields) {
              $missedFields = array_diff($thoughFields, $existedFields);
  
              if (count($missedFields) === count($thoughFields)) {
                  throw new EmptyRequiredPropertyException(sprintf('There must be at least one field: %s', join(' or ', $thoughFields)));
              }
          }
  
      }
docs: @param DataContainerInterface $object
  
  @throws BadGetterException
  @throws EmptyRequiredPropertyException
  @throws InvalidPropertyException
  @throws InvalidPropertyTypeException