original_string: protected function processExistingItems()
      {
          $loadedIndexes = $loadedGroups = [];
          $loadValue = $this->getLoadValue();
  
          // Ensure that the minimum number of items are preinitialized
          // ONLY DONE WHEN NOT IN GROUP MODE
          if (!$this->useGroups && $this->minItems > 0) {
              if (!is_array($loadValue)) {
                  $loadValue = [];
                  for ($i = 0; $i < $this->minItems; $i++) {
                      $loadValue[$i] = [];
                  }
              } elseif (count($loadValue) < $this->minItems) {
                  for ($i = 0; $i < ($this->minItems - count($loadValue)); $i++) {
                      $loadValue[] = [];
                  }
              }
          }
  
          if (is_array($loadValue)) {
              foreach ($loadValue as $index => $loadedValue) {
                  $loadedIndexes[] = $index;
                  $loadedGroups[] = array_get($loadedValue, '_group');
              }
          }
  
          $itemIndexes = post($this->indexInputName, $loadedIndexes);
          $itemGroups = post($this->groupInputName, $loadedGroups);
  
          if (!count($itemIndexes)) {
              return;
          }
  
          $items = array_combine(
              (array) $itemIndexes,
              (array) ($this->useGroups ? $itemGroups : $itemIndexes)
          );
  
          foreach ($items as $itemIndex => $groupCode) {
              $this->makeItemFormWidget($itemIndex, $groupCode);
              $this->indexCount = max((int) $itemIndex, $this->indexCount);
          }
      }
code: protected function processExistingItems()
      {
          $loadedIndexes = $loadedGroups = [];
          $loadValue = $this->getLoadValue();
  
          // Ensure that the minimum number of items are preinitialized
          // ONLY DONE WHEN NOT IN GROUP MODE
          if (!$this->useGroups && $this->minItems > 0) {
              if (!is_array($loadValue)) {
                  $loadValue = [];
                  for ($i = 0; $i < $this->minItems; $i++) {
                      $loadValue[$i] = [];
                  }
              } elseif (count($loadValue) < $this->minItems) {
                  for ($i = 0; $i < ($this->minItems - count($loadValue)); $i++) {
                      $loadValue[] = [];
                  }
              }
          }
  
          if (is_array($loadValue)) {
              foreach ($loadValue as $index => $loadedValue) {
                  $loadedIndexes[] = $index;
                  $loadedGroups[] = array_get($loadedValue, '_group');
              }
          }
  
          $itemIndexes = post($this->indexInputName, $loadedIndexes);
          $itemGroups = post($this->groupInputName, $loadedGroups);
  
          if (!count($itemIndexes)) {
              return;
          }
  
          $items = array_combine(
              (array) $itemIndexes,
              (array) ($this->useGroups ? $itemGroups : $itemIndexes)
          );
  
          foreach ($items as $itemIndex => $groupCode) {
              $this->makeItemFormWidget($itemIndex, $groupCode);
              $this->indexCount = max((int) $itemIndex, $this->indexCount);
          }
      }
code_tokens: protected function processExistingItems ( ) { $ loadedIndexes = $ loadedGroups = [ ] ; $ loadValue = $ this -> getLoadValue ( ) ; // Ensure that the minimum number of items are preinitialized // ONLY DONE WHEN NOT IN GROUP MODE if ( ! $ this -> useGroups && $ this -> minItems > 0 ) { if ( ! is_array ( $ loadValue ) ) { $ loadValue = [ ] ; for ( $ i = 0 ; $ i < $ this -> minItems ; $ i ++ ) { $ loadValue [ $ i ] = [ ] ; } } elseif ( count ( $ loadValue ) < $ this -> minItems ) { for ( $ i = 0 ; $ i < ( $ this -> minItems - count ( $ loadValue ) ) ; $ i ++ ) { $ loadValue [ ] = [ ] ; } } } if ( is_array ( $ loadValue ) ) { foreach ( $ loadValue as $ index => $ loadedValue ) { $ loadedIndexes [ ] = $ index ; $ loadedGroups [ ] = array_get ( $ loadedValue , '_group' ) ; } } $ itemIndexes = post ( $ this -> indexInputName , $ loadedIndexes ) ; $ itemGroups = post ( $ this -> groupInputName , $ loadedGroups ) ; if ( ! count ( $ itemIndexes ) ) { return ; } $ items = array_combine ( ( array ) $ itemIndexes , ( array ) ( $ this -> useGroups ? $ itemGroups : $ itemIndexes ) ) ; foreach ( $ items as $ itemIndex => $ groupCode ) { $ this -> makeItemFormWidget ( $ itemIndex , $ groupCode ) ; $ this -> indexCount = max ( ( int ) $ itemIndex , $ this -> indexCount ) ; } }
docstring: Processes existing form data and applies it to the form widgets.
  @return void
docstring_tokens: Processes existing form data and applies it to the form widgets .