original_string: protected function formatField(Field $field)
      {
          $jsonKey = $field->column();
  
          $elementName = $elementClass = $errorKey = [];
  
          if (is_array($jsonKey)) {
              foreach ($jsonKey as $index => $name) {
                  $elementName[$index] = "{$this->column}[$name]";
                  $errorKey[$index] = "{$this->column}.$name";
                  $elementClass[$index] = "{$this->column}_$name";
              }
          } else {
              $elementName = "{$this->column}[$jsonKey]";
              $errorKey = "{$this->column}.$jsonKey";
              $elementClass = "{$this->column}_$jsonKey";
          }
  
          $field->setElementName($elementName)
              ->setErrorKey($errorKey)
              ->setElementClass($elementClass);
  
          return $field;
      }
code: protected function formatField(Field $field)
      {
          $jsonKey = $field->column();
  
          $elementName = $elementClass = $errorKey = [];
  
          if (is_array($jsonKey)) {
              foreach ($jsonKey as $index => $name) {
                  $elementName[$index] = "{$this->column}[$name]";
                  $errorKey[$index] = "{$this->column}.$name";
                  $elementClass[$index] = "{$this->column}_$name";
              }
          } else {
              $elementName = "{$this->column}[$jsonKey]";
              $errorKey = "{$this->column}.$jsonKey";
              $elementClass = "{$this->column}_$jsonKey";
          }
  
          $field->setElementName($elementName)
              ->setErrorKey($errorKey)
              ->setElementClass($elementClass);
  
          return $field;
      }
code_tokens: protected function formatField ( Field $ field ) { $ jsonKey = $ field -> column ( ) ; $ elementName = $ elementClass = $ errorKey = [ ] ; if ( is_array ( $ jsonKey ) ) { foreach ( $ jsonKey as $ index => $ name ) { $ elementName [ $ index ] = "{$this->column}[$name]" ; $ errorKey [ $ index ] = "{$this->column}.$name" ; $ elementClass [ $ index ] = "{$this->column}_$name" ; } } else { $ elementName = "{$this->column}[$jsonKey]" ; $ errorKey = "{$this->column}.$jsonKey" ; $ elementClass = "{$this->column}_$jsonKey" ; } $ field -> setElementName ( $ elementName ) -> setErrorKey ( $ errorKey ) -> setElementClass ( $ elementClass ) ; return $ field ; }
docstring: Format form, set `element name` `error key` and `element class`.
  
  @param Field $field
  
  @return Field
docstring_tokens: Format form set element name error key and element class .