code: static public function fixValidationErrorsKeys(array $errors) {
          foreach ($errors as $key => $messages) {
              if (strpos($key, '.') !== false) {
                  $newKey = preg_replace(
                      ['%^([^\]]+)\]%', '%\[\]\]%'],
                      ['$1', '][]'],
                      str_replace('.', '][', $key) . ']'
                  );
                  $errors[$newKey] = $messages;
                  unset($errors[$key]);
              }
          }
  
          return $errors;
      }
docs: Replace keys like 'some.column' by 'some[column]' to fit <input> names
  @param array $errors
  @return array