original_string: public function addRows($rows)
      {
          foreach ($rows as $row) {
              $this->inputRows[] = $row;
              $inferredRow = $this->inferRow($row);
              foreach ($this->getFieldNames() as $fieldName) {
                  /** @var BaseField $inferredField */
                  $inferredField = $inferredRow[$fieldName];
                  $inferredFieldType = $inferredField->getInferIdentifier($this->lenient);
                  if (!array_key_exists($fieldName, $this->fieldsPopularity)) {
                      $this->fieldsPopularity[$fieldName] = [];
                      $this->fieldsPopularityObjects[$fieldName] = [];
                  }
                  if (!array_key_exists($inferredFieldType, $this->fieldsPopularity[$fieldName])) {
                      $this->fieldsPopularity[$fieldName][$inferredFieldType] = 0;
                      $this->fieldsPopularityObjects[$fieldName][$inferredFieldType] = $inferredField;
                  }
                  ++$this->fieldsPopularity[$fieldName][$inferredFieldType];
                  arsort($this->fieldsPopularity[$fieldName]);
              }
          }
      }
code: public function addRows($rows)
      {
          foreach ($rows as $row) {
              $this->inputRows[] = $row;
              $inferredRow = $this->inferRow($row);
              foreach ($this->getFieldNames() as $fieldName) {
                  /** @var BaseField $inferredField */
                  $inferredField = $inferredRow[$fieldName];
                  $inferredFieldType = $inferredField->getInferIdentifier($this->lenient);
                  if (!array_key_exists($fieldName, $this->fieldsPopularity)) {
                      $this->fieldsPopularity[$fieldName] = [];
                      $this->fieldsPopularityObjects[$fieldName] = [];
                  }
                  if (!array_key_exists($inferredFieldType, $this->fieldsPopularity[$fieldName])) {
                      $this->fieldsPopularity[$fieldName][$inferredFieldType] = 0;
                      $this->fieldsPopularityObjects[$fieldName][$inferredFieldType] = $inferredField;
                  }
                  ++$this->fieldsPopularity[$fieldName][$inferredFieldType];
                  arsort($this->fieldsPopularity[$fieldName]);
              }
          }
      }
code_tokens: public function addRows ( $ rows ) { foreach ( $ rows as $ row ) { $ this -> inputRows [ ] = $ row ; $ inferredRow = $ this -> inferRow ( $ row ) ; foreach ( $ this -> getFieldNames ( ) as $ fieldName ) { /** @var BaseField $inferredField */ $ inferredField = $ inferredRow [ $ fieldName ] ; $ inferredFieldType = $ inferredField -> getInferIdentifier ( $ this -> lenient ) ; if ( ! array_key_exists ( $ fieldName , $ this -> fieldsPopularity ) ) { $ this -> fieldsPopularity [ $ fieldName ] = [ ] ; $ this -> fieldsPopularityObjects [ $ fieldName ] = [ ] ; } if ( ! array_key_exists ( $ inferredFieldType , $ this -> fieldsPopularity [ $ fieldName ] ) ) { $ this -> fieldsPopularity [ $ fieldName ] [ $ inferredFieldType ] = 0 ; $ this -> fieldsPopularityObjects [ $ fieldName ] [ $ inferredFieldType ] = $ inferredField ; } ++ $ this -> fieldsPopularity [ $ fieldName ] [ $ inferredFieldType ] ; arsort ( $ this -> fieldsPopularity [ $ fieldName ] ) ; } } }
docstring: add rows and updates the fieldsPopularity array - to make the inferred fields more accurate.
  
  @param $rows
  
  @throws FieldValidationException
docstring_tokens: add rows and updates the fieldsPopularity array - to make the inferred fields more accurate .