original_string: protected function addCheckFields()
      {
          $check = 1;
          foreach ($this->checkFields as $label => &$value) {
              if ($value instanceof \Zend_Form_Element) {
                  $element = $value;
              } else {
                  if ($value) {
                      $element = new \Zend_Form_Element_Text('check_' . $check);
                      $element->setAllowEmpty(false);
                      $element->setLabel($label);
  
                      $validator = new \Zend_Validate_Identical($value);
                      $validator->setMessage(
                              sprintf($this->_('%s is not correct.'), $label),
                              \Zend_Validate_Identical::NOT_SAME
                              );
                      $element->addValidator($validator);
  
                      $value = $element;
                      $check++;
                  } else {
                      // Nothing to check for
                      unset($this->checkFields[$label]);
                      continue;
                  }
              }
              $this->addElement($element);
          }
      }
code: protected function addCheckFields()
      {
          $check = 1;
          foreach ($this->checkFields as $label => &$value) {
              if ($value instanceof \Zend_Form_Element) {
                  $element = $value;
              } else {
                  if ($value) {
                      $element = new \Zend_Form_Element_Text('check_' . $check);
                      $element->setAllowEmpty(false);
                      $element->setLabel($label);
  
                      $validator = new \Zend_Validate_Identical($value);
                      $validator->setMessage(
                              sprintf($this->_('%s is not correct.'), $label),
                              \Zend_Validate_Identical::NOT_SAME
                              );
                      $element->addValidator($validator);
  
                      $value = $element;
                      $check++;
                  } else {
                      // Nothing to check for
                      unset($this->checkFields[$label]);
                      continue;
                  }
              }
              $this->addElement($element);
          }
      }
code_tokens: protected function addCheckFields ( ) { $ check = 1 ; foreach ( $ this -> checkFields as $ label => & $ value ) { if ( $ value instanceof \ Zend_Form_Element ) { $ element = $ value ; } else { if ( $ value ) { $ element = new \ Zend_Form_Element_Text ( 'check_' . $ check ) ; $ element -> setAllowEmpty ( false ) ; $ element -> setLabel ( $ label ) ; $ validator = new \ Zend_Validate_Identical ( $ value ) ; $ validator -> setMessage ( sprintf ( $ this -> _ ( '%s is not correct.' ) , $ label ) , \ Zend_Validate_Identical :: NOT_SAME ) ; $ element -> addValidator ( $ validator ) ; $ value = $ element ; $ check ++ ; } else { // Nothing to check for unset ( $ this -> checkFields [ $ label ] ) ; continue ; } } $ this -> addElement ( $ element ) ; } }
docstring: Add user defined checkfields
  
  @return void
docstring_tokens: Add user defined checkfields