original_string: public function validation($data, $files) {
          $errors = parent::validation($data, $files);
  
          if (isset($data['clustered']) && ($data['clustered'] == 1)) {
              // Set servers is required with in cluster mode.
              if (!isset($data['setservers'])) {
                  $errors['setservers'] = get_string('required');
              } else {
                  $trimmed = trim($data['setservers']);
                  if (empty($trimmed)) {
                      $errors['setservers'] = get_string('required');
                  }
              }
  
              $validservers = false;
              if (isset($data['servers'])) {
                  $servers = trim($data['servers']);
                  $servers = explode("\n", $servers);
                  if (count($servers) === 1) {
                      $validservers = true;
                  }
              }
  
              if (!$validservers) {
                  $errors['servers'] = get_string('serversclusterinvalid', 'cachestore_memcached');
              }
          }
  
          return $errors;
      }
code: public function validation($data, $files) {
          $errors = parent::validation($data, $files);
  
          if (isset($data['clustered']) && ($data['clustered'] == 1)) {
              // Set servers is required with in cluster mode.
              if (!isset($data['setservers'])) {
                  $errors['setservers'] = get_string('required');
              } else {
                  $trimmed = trim($data['setservers']);
                  if (empty($trimmed)) {
                      $errors['setservers'] = get_string('required');
                  }
              }
  
              $validservers = false;
              if (isset($data['servers'])) {
                  $servers = trim($data['servers']);
                  $servers = explode("\n", $servers);
                  if (count($servers) === 1) {
                      $validservers = true;
                  }
              }
  
              if (!$validservers) {
                  $errors['servers'] = get_string('serversclusterinvalid', 'cachestore_memcached');
              }
          }
  
          return $errors;
      }
code_tokens: public function validation ( $ data , $ files ) { $ errors = parent :: validation ( $ data , $ files ) ; if ( isset ( $ data [ 'clustered' ] ) && ( $ data [ 'clustered' ] == 1 ) ) { // Set servers is required with in cluster mode. if ( ! isset ( $ data [ 'setservers' ] ) ) { $ errors [ 'setservers' ] = get_string ( 'required' ) ; } else { $ trimmed = trim ( $ data [ 'setservers' ] ) ; if ( empty ( $ trimmed ) ) { $ errors [ 'setservers' ] = get_string ( 'required' ) ; } } $ validservers = false ; if ( isset ( $ data [ 'servers' ] ) ) { $ servers = trim ( $ data [ 'servers' ] ) ; $ servers = explode ( "\n" , $ servers ) ; if ( count ( $ servers ) === 1 ) { $ validservers = true ; } } if ( ! $ validservers ) { $ errors [ 'servers' ] = get_string ( 'serversclusterinvalid' , 'cachestore_memcached' ) ; } } return $ errors ; }
docstring: Perform minimal validation on the settings form.
  
  @param array $data
  @param array $files
docstring_tokens: Perform minimal validation on the settings form .